0

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

2
  • 1
    Can you rephrase this question? I do not understand what you are trying to ask because your English is a little bit unwieldy. Commented Jun 11, 2010 at 20:04
  • 1
    why can't you just use regex and replace the characters you don't want? Commented Jun 11, 2010 at 20:13

2 Answers 2

6

When generating your URL parameters, use:

paramString = URLEncoder.encode(paramString, "utf-8");
Sign up to request clarification or add additional context in comments.

Comments

2

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", "");

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.