譬如说 我有这样一个字符串
String strTemp="This is a test, and that is also a test.";
String strSplit[]=strTemp.split(正则表达式),split 成
This
is
a
test
and
that
is
also
a
test.
就是将字符串有空格或者, (逗号)都要分割。
高手指点。
...全文
10008打赏收藏
请教如何用正则表达式将一个字符串按照空格和逗号分割!!
譬如说 我有这样一个字符串 String strTemp="This is a test, and that is also a test."; String strSplit[]=strTemp.split(正则表达式),split 成 This is a test and that is also a test. 就是将字符串有空格或者, (逗号)都要分割。 高手指点。