Wrapping Strings
6 October 2008Its always useful to wrap strings if they are too long. This provides better readability. Eclipse has support for this.
String literals can wrapped when you edit them. Place your cursor at the point of literal where you want to wrap and press Enter. For example:
String message= "Java is fun to learn and it sure is a popular programming language.";
I kept the cursor at ‘sure’ and pressed enter key. The String was changed to:
String message= "Java is fun to learn and it sure” + “is a popular programming language.";
This behavior can be customized in the Java > Editor > Typing preference page.
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Wrapping Strings