You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see in the source code that removeAt(int index) only removes the first match:
/// remove the character in [index] of the given string.
String removeAt(int index) {
var selectStr = _mainStr[index];
return _mainStr.replaceFirst('$selectStr', '');
}
This implementation is wrong. The following code shows how this can appear:
// 01234567
var str1 = "12.34.56";
print(str1.stringUtils().removeAt(5));
The element at position 5 was not removed, instead the element at position 2 was.
The text was updated successfully, but these errors were encountered:
You can see in the source code that
removeAt(int index)
only removes the first match:This implementation is wrong. The following code shows how this can appear:
The element at position 5 was not removed, instead the element at position 2 was.
The text was updated successfully, but these errors were encountered: