StringExt extension
Extension on String providing various string manipulation and validation utilities.
This extension adds helpful methods for string operations like truncation, substring extraction, and pattern validation.
- on
Properties
- containsOnlyNumbers → bool
-
Available on String, provided by the StringExt extension
Returnstrueif this string contains only numeric digits (0-9).no setter - startsWithPlusAndContainsOnlyNumbers → bool
-
Available on String, provided by the StringExt extension
Returnstrueif this string starts with a plus sign and contains only numeric digits after it.no setter
Methods
-
isAnyOf(
List< String> items) → bool -
Available on String, provided by the StringExt extension
Returnstrueif this string is equal to any string initems. -
takeAfter(
String search) → String -
Available on String, provided by the StringExt extension
Returns the substring after the first occurrence ofsearch. -
takeAfterLast(
String search) → String -
Available on String, provided by the StringExt extension
Returns the substring after the last occurrence ofsearch. -
takeLeft(
int characterCount, {bool addEllipses = false}) → String -
Available on String, provided by the StringExt extension
Returns the leftmostcharacterCountcharacters of this string.
Static Properties
- regexNumbersOnly ↔ RegExp
-
Available on String, provided by the StringExt extension
Regular expression pattern for matching strings containing only digits (0-9).getter/setter pair - regexStartsWithPlusAndThenOnlyNumbers ↔ RegExp
-
Available on String, provided by the StringExt extension
Regular expression pattern for matching strings that start with a plus sign followed by only digits.getter/setter pair