Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified
Accepted Solution

remove space from string

Hi friends

I have a string which contain spaces, is there any function , other than parsing the string, that allow me to remove all spaces

(spaces are not at the two ends)

 

thanks in advance

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: remove space from string

There is no built-in functionality to trim all spaces from the string.

 

But you can implement your own method.

 

Are you experiencing problem with this ?

Highlighted
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: remove space from string

How about StringUtilities.removeChars()

 

Something like this:

 

String newString = StringUtilities.removeChars(myString, " ")

 

...should remove the blanks.

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: remove space from string

Yes, you're right, RexDoug.
Developer
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea

Re: remove space from string

Hi RexDoug.,

 I want the Same think but i want to remove the word from the String.

 

When i am using the StringUtility it will remove all the char which is contanig that word char ..

 

Any idea other solution??

 

Thanks
Rajesh Parmar


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Contributor
Posts: 40
Registered: ‎08-17-2010
My Device: Not Specified

Re: remove space from string

Hi RexDoug,

 

        i want to replace spaces with %20 how can i do it need help

 

TIA