0

I can't find if there is a way to write very long strings in XML in multiple lines without affecting string behavior in the code.

I have FAQ section and Answers to some questions are EG 3-4 sentences, some 400 characters long. So for each "Enter" ("Return") that I've pressed in my Strings file, I get new paragraph when displaying this in the app.

I've read here that concatenation is not working, but I do not really need it, I need to escape new paragraph that occurs when enter is pressed.

2
  • do you are talking about not beeing able to paste the long string in Eclipse(scipping characters) or in your App? It is a bit unclear to me what your problem is. If possible post a screenshot :) Commented Oct 15, 2012 at 23:06
  • I'm talking about Eclipse. XML with Strings. If you have a long long long string, and want to be able to read it, if you put "enter" (new line) it ends up with new paragraph in the Application. Commented Oct 16, 2012 at 18:43

1 Answer 1

2

Also, you can use \n:

<string name="about_message">
    Line1\nLine2\nLine3
</string>
Sign up to request clarification or add additional context in comments.

1 Comment

Exactly opposite :) I'm aware of new line indent (\n) which CREATES new line when app is running, but I'd like to format my text within XML that I do not have to scroll from left to right, and avoid new lines, tabs or paragraphs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.