-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Dart should have methods that are able to remove specified leading and trailing parts of a string. I propose using strip
and it's associates, stripLeft
and stripRight
to keep in line with trim
.
"@bar".stripLeft('@'); // "bar"
"bar@".stripRight('@'); // "bar"
"@bar@".strip('@'); // "bar"
"@@bar".stripLeft('@'); // "bar"
"@@bar".stripLeft('@@'); // "bar"
"@@bar".stripLeft('@@@'); // "@@bar"
"@@@bar".stripLeft('@@'); // "@bar"
The signature for the methods would be:
String strip(String pattern) {} // Only String, see lrhn's comment about matching backwards with RegEx
String stripLeft(Pattern pattern) {}
String stripRight(String string) {} // Only String, see lrhn's comment about matching backwards with RegEx
FMorschel and AbdeMohlbi
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug