-1

I am currently trying to make use of the java string function someString.replaceAll() to find commonly used words (and, the, by, of, etc) and replace them with " ". Based on the answers to the question at Whitespace Matching Regex - Java, I produced this function call:

data.replaceAll("(?i)\\sthe\\s", " ")

However, it isnt working and I'm really not sure why. Nothing about it looks wrong based on what I've found. Please help me!

4

1 回答 1

7

字符串是不可变的!

data = data.replaceAll("(?i)\\sthe\\s", " ");
于 2013-07-02T19:21:56.630 回答