我想在 Java 中的字符串中第二次出现空格后删除文本。不应使用正则表达式。
输入:
String S1 = "VOLKSWAGEN OF SANLEANDRO";
String S2 = "Stack Overflow Site";
String S3 = "Java Learning"; -- there is only one space
输出:
VOLKSWAGEN OF
Stack Overflow
Java Learning // as there is no second space entire string should be displayed