📜  java string.split 与 .不会工作 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:24.255000             🧑  作者: Mango

代码示例1
//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);