< Day Day Up > |
Recipe 3.13 Automatically Wrapping Strings3.13.1 ProblemYour text strings are getting too long for the width of the screen, and you're getting tired of scrolling to the ends of the strings to edit them. 3.13.2 SolutionLet Eclipse break the strings for you. Just position the cursor in the quoted text to break, and press Enter. 3.13.3 DiscussionEclipse handles breaking strings in Java code well. Say you have the following text string: String text = "This is a long string of text."; You can put the cursor caret in the middle of the string and press Enter; Eclipse will do the right Java thing by splitting up the quoted text like so: String text = "This is a long " + "string of text.";
|
< Day Day Up > |