MCPcopy
hub / github.com/google/guava / onPattern

Method onPattern

guava/src/com/google/common/base/Splitter.java:246–249  ·  view source on GitHub ↗

Returns a splitter that considers any subsequence matching a given pattern (regular expression) to be a separator. For example, {@code 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

244 * malformed expression
245 */
246 @GwtIncompatible // java.util.regex
247 public static Splitter onPattern(String separatorPattern) {
248 return onPatternInternal(Platform.compilePattern(separatorPattern));
249 }
250
251 /**
252 * Returns a splitter that divides strings into pieces of the given length. For example, {@code

Calls 2

onPatternInternalMethod · 0.95
compilePatternMethod · 0.95