一个String =“这是a.line是.over”
应该站出来为
“这是一个.line区段is.Over”
我想用串标记者两次
-first split using"."
-second split using " " to get the first word
-then change charAt[0].toUpper
现在我没有确定如何使用字符串标记器的输出作为另一个输入?
也我可以使用分割方法来生成阵列东西我试图
String a="this is.a good boy";
String [] dot=a.split("\\.");
while(i<dot.length)
{
String [] sp=dot[i].split(" ");
sp[0].charAt(0).toUpperCase();// what to do with this part?
你不需要t他第二次分裂使charAt [0] .toUpper(),一个修剪就足够了。 – Pino
查看此前[answer](http://stackoverflow.com/questions/1892765/capitalize-first-char-of-each-word-in-a-string-java) – GrahamA
@ Bhaskar-问题有点不同在这里我有一个字符串与多个句子,所以首先我想拆分句子,然后大写这个词..我的困惑是关于如何传递到第二个拆分 – kshitij