stringSubtract function
Subtract characters one at at ime from charsToDelete
Implementation
String stringSubtract(String original, String charsToDelete) {
if (original.isEmpty) {
return '';
}
if (charsToDelete.isEmpty) {
return original;
}
List<int> originalCodes = original.codeUnits;
List<int> deleteCodes = charsToDelete.codeUnits;
return String.fromCharCodes(
listSubtract(originalCodes, deleteCodes),
);
}