apartReverseBy method
通过gap字符串分割字符串, 从后到前分析
返回一个元组,包含分割后的第一个部分和剩余部分。 如果gap不存在,则返回(null, 原字符串)
Implementation
(String?, String?) apartReverseBy(String gap) {
final int pos = this.lastIndexOf(gap);
if (pos == -1) {
return (null, this);
}
final String first = this.substring(0, pos);
final String last = this.substring(pos + gap.length);
return (first, last);
}