firstSplit method
- Pattern pattern
Returns the first element after splitting the string using the specified pattern
.
If the string cannot be split, it returns the original string.
Implementation
string firstSplit(Pattern pattern) => split(pattern).first;