Answers for "java string.split with . wont work"

0

java string.split with . wont work

//Java

String sentence = "Hello World.How are you?";
String[] newSentence = sentence.split("\\.");
String firstString = newSentence[0];
String secondString = newSentence[1];
System.out.println(firstString + ' ' + secondString);
Posted by: Guest on January-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language