- 1

Java code to find new line character in a string without using loop?

new line character

15th Feb 2018, 5:05 AM
Ganesh Nandyala
Ganesh Nandyala - avatar
2 Antworten
+ 2
Have you tried using string.contains("\n"); String s = "hello\nhow are you?"; if(s.contains("\n")) { System.out.println("Yes"); }
15th Feb 2018, 5:27 AM
ChaoticDawg
ChaoticDawg - avatar