Are there any other opening letters other than \n? Or is there another way to open it?

Asked 2 years ago, Updated 2 years ago, 96 views

\nIs there any other text that goes to the next line? I can't.

java cross-platform newline eol

2022-09-21 17:43

1 Answers

You can use %n in String.format().

Calendar c = ...;
String = String.format ("Sungguk's birthday: %1$tm %1$te, %1$tY%n", c); 
//^^'%n' indicates opening ^^

String2 = String.format ("%%n" is used for opening. %n"); 
//  '%%' is used to output % ^^
//     Write %n as indicated by ^^ to the next line.     ^^

This is how you use it


2022-09-21 17:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.