+ 1
How Can Add New Line Print If Include "##" With Single String In Java ????
Sting = "##This is Demo line ##This is a Question ## Give Me Answer of This Question ## Can You Help Me"; OutPut Line:------ ##This is Demo line ##This is a Question ## Give Me Answer of This Question ## Can You Help Me" ââââ Main Point ââââ After "##" Not Also Same Line
3 Answers
0
String str = "## This is Demo line ## This is a Question ## Give Me Answer of This Question ## Can You Help Me";
str = str.replaceAll("##","\n##");
System.out.println( str.substring(1) );
0
String str = "##This is Demo line ##This is a Question ## Give Me Answer of This Question ## Can You Help Me";
String[] strarr = str.split("#");
for(String s: strarr)
System.out.println(s);
//hope it helps