tags:

views:

110

answers:

3

hi folks,

I have working in facebook for my app in android. it have to use the string to pass as a url. But my description value has lot of spaces and line breaks. i have to rectify while passing that value as url without spaces. but it will posted on the facebook wall with the spaces. Is it possible?Any Idea.

+4  A: 

When generating your URL parameters, use

 paramString = URLEncoder.encode(paramString, "utf-8");
Bozho
+1  A: 

I'm not sure if you're asking how to properly encode the URL so it has no whitespace, or if you want to remove line breaks from a string. If you want to remove line breaks from a string, do this:

yourString.replaceAll("\n", "");

Jeff
+1  A: 

I asked something similar a while ago. Maybe the answer to that question helps you some way.

Fernando