Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.regex.Pattern;
- public class StringSplitter {
- private Pattern spacesPattern;
- private static final String REGEX_STRING = "\\s+";
- public StringSplitter() {
- this.spacesPattern = Pattern.compile(REGEX_STRING);
- }
- public String[] nonPrecompiledTest(String bigS) {
- return bigS.split(REGEX_STRING);
- }
- public String[] precompiledTest(String bigS) {
- return this.spacesPattern.split(bigS);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement