Java String Manipulation ReplaceAll -
i new java not programming in general. i've been trying understand java string replaceall...specifically reading in strings text file...an example "i jump high in air you."
1) want change "i" "a" not beginning of word, , 2) u "o" u @ end of word. appreciated. (also, if can point me tutorial on topic [i learn best looking @ examples] appreciated)
try this.
string s = "i jump high in air you."; s = s.replaceall("(?!\\b)i", "a") .replaceall("u\\b", "o"); system.out.println(s); // -> jump hagh in aar yoo.
Comments
Post a Comment