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

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -