new_string = old_string.replaceFirst(regularExpresionFind, textReplace);
To make this non-case sensitive / case insenitive:
new_string = old_string.replaceFirst("(?i)" + regularExpresionFind, textReplace);
Windows, Linux, Mac OS X, Java and Ruby Tips and Tricks
new_string = old_string.replaceFirst(regularExpresionFind, textReplace);
new_string = old_string.replaceFirst("(?i)" + regularExpresionFind, textReplace);
No comments:
Post a Comment