相关疑难解决方法(0)

Java的.将多个单词字符串拆分为每个空格的两个单词字符串

昨晚在这里回答第一轮.@Reimeus提供的解决方案很棒,并提供以下输出:

My name is the mighty llama
Run Code Online (Sandbox Code Playgroud)

至:

String[] stringArray = string.split("(?<!\\G\\S+)\\s");

My name 
is the
mighty llama
Run Code Online (Sandbox Code Playgroud)

但是,我现在发现自己需要纠正我正在做的事情.我实际上需要能够像这样拆分字符串.

My name
name is
is the
the mighty
mighty llama
Run Code Online (Sandbox Code Playgroud)

java regex

2
推荐指数
1
解决办法
1913
查看次数

标签 统计

java ×1

regex ×1