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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -