dartx icon indicating copy to clipboard operation
dartx copied to clipboard

Add String.removeWhere

Open ThinkDigitalSoftware opened this issue 6 years ago • 1 comments

Same as List.removeWhere but for characters and patterns. This will basically wrap the replaceAll call and default the second parameter to an empty string

ThinkDigitalSoftware avatar Dec 15 '19 20:12 ThinkDigitalSoftware

With a list you have a list of items. The function given to the method applies it to every item. The problem with a string is the definition of an item in this context. The first definition that comes to my mind is that one each character of a string is an item. For example:

// this would result as: hell wrld
'hello world'.removeWhere((c) => c == 'o');

Do you mean that? Do you have an example or more specified definition?

komape avatar Mar 19 '21 12:03 komape