...
Code Block | ||
---|---|---|
| ||
public class Splitter { private final String WORDS = "\\b"; // interpreted as two chars, '\' and \'b'. Correctly splits on word boundaries public String[] split(String input){ Pattern pattern = Pattern.compile(WORDS); String[] input_array = pattern.split(input); return input_array; } } |
...