rightOf method
Returns the right side of the String
starting from char
.
Example
String s = 'peanutbutter';
String foo = s.rightOf('peanut'); // returns 'butter'
Implementation
String? rightOf(String char) {
if (this == null) {
return null;
}
if (this!.isEmpty) {
return this;
}
final int index = this!.indexOf(char);
return this!.substring(index + char.length, this!.length);
}