MCPcopy Create free account
hub / github.com/antlr/codebuff / onPattern

Method onPattern

corpus/java/training/guava/base/Splitter.java:252–255  ·  view source on GitHub ↗

Returns a splitter that considers any subsequence matching a given pattern (regular expression) to be a separator. For example, Splitter.onPattern("\r?\n").split(entireFile) splits a string into lines whether it uses DOS-style or UNIX-style line terminators. This is equivalent to {@code Spli

(String separatorPattern)

Source from the content-addressed store, hash-verified

250 * @throws IllegalArgumentException if {@code separatorPattern} matches the empty string
251 */
252 @GwtIncompatible // java.util.regex
253 public static Splitter onPattern(String separatorPattern) {
254 return on(Pattern.compile(separatorPattern));
255 }
256
257 /**
258 * Returns a splitter that divides strings into pieces of the given length. For example,

Callers 1

Calls 2

onMethod · 0.95
compileMethod · 0.45

Tested by

no test coverage detected