📜  java拆分字符串而不删除 - Java代码示例

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

代码示例1
String string = "Hello-World";
String[] split = string.Replace("-", "#-").Split("#"); 
//# is added to the Splitpoint so we can split on #

Output:
split = [Hello, -World]