BAEL-3587: Added %n new line example.

This commit is contained in:
Justin Albano 2020-03-24 19:56:27 -04:00
parent 060557608c
commit 7ad1542856
1 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,11 @@ public class AddingNewLineToString {
System.out.println("6. Using System.getProperty(\"line.separator\")");
rhyme = line1 + System.getProperty("line.separator") + line2;
System.out.println(rhyme);
//6. Using %n
System.out.println("7. Using %n");
rhyme = "Humpty Dumpty sat on a wall.%nHumpty Dumpty had a great fall.";
System.out.println(rhyme);
System.out.println("***HTML to rendered in a browser***");
//1. Line break for HTML using <br>