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)
| 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 |