ObjStringExt extension
Properties
-
codeUnits
→ List<
int> -
Available on Obj<
An unmodifiable list of the UTF-16 code units of this string.String> , provided by the ObjStringExt extensionno setter - isEmpty → bool
-
Available on Obj<
Whether this string is empty.String> , provided by the ObjStringExt extensionno setter - isNotEmpty → bool
-
Available on Obj<
Whether this string is not empty.String> , provided by the ObjStringExt extensionno setter - length → int
-
Available on Obj<
The length of the string.String> , provided by the ObjStringExt extensionno setter - runes → Runes
-
Available on Obj<
An Iterable of Unicode code-points of this string.String> , provided by the ObjStringExt extensionno setter
Methods
-
codeUnitAt(
int index) → int -
Available on Obj<
Returns the 16-bit UTF-16 code unit at the givenString> , provided by the ObjStringExt extensionindex
. -
compareTo(
String other) → int -
Available on Obj<
Compares this string toString> , provided by the ObjStringExt extensionother
. -
contains(
Pattern other, [int startIndex = 0]) → bool -
Available on Obj<
Whether this string contains a match ofString> , provided by the ObjStringExt extensionother
. -
endsWith(
String other) → bool -
Available on Obj<
Whether this string ends withString> , provided by the ObjStringExt extensionother
. -
indexOf(
Pattern pattern, [int start = 0]) → int -
Available on Obj<
Returns the position of the first match ofString> , provided by the ObjStringExt extensionpattern
in this string, starting atstart
, inclusive: -
lastIndexOf(
Pattern pattern, [int? start]) → int -
Available on Obj<
The starting position of the last matchString> , provided by the ObjStringExt extensionpattern
in this string. -
padLeft(
int width, [String padding = ' ']) → String -
Available on Obj<
Pads this string on the left if it is shorter thanString> , provided by the ObjStringExt extensionwidth
. -
padRight(
int width, [String padding = ' ']) → String -
Available on Obj<
Pads this string on the right if it is shorter thanString> , provided by the ObjStringExt extensionwidth
. -
replaceAll(
Pattern from, String replace) → String -
Available on Obj<
Replaces all substrings that matchString> , provided by the ObjStringExt extensionfrom
withreplace
. -
replaceAllMapped(
Pattern from, String replace(Match match)) → String -
Available on Obj<
Replace all substrings that matchString> , provided by the ObjStringExt extensionfrom
by a computed string. -
replaceFirst(
Pattern from, String to, [int startIndex = 0]) → String -
Available on Obj<
Creates a new string with the first occurrence ofString> , provided by the ObjStringExt extensionfrom
replaced byto
. -
replaceFirstMapped(
Pattern from, String replace(Match match), [int startIndex = 0]) → String -
Available on Obj<
Replace the first occurrence ofString> , provided by the ObjStringExt extensionfrom
in this string. -
replaceRange(
int start, int? end, String replacement) → String -
Available on Obj<
Replaces the substring fromString> , provided by the ObjStringExt extensionstart
toend
withreplacement
. -
split(
Pattern pattern) → List< String> -
Available on Obj<
Splits the string at matches ofString> , provided by the ObjStringExt extensionpattern
and returns a list of substrings. -
splitMapJoin(
Pattern pattern, {String onMatch(Match)?, String onNonMatch(String)?}) → String -
Available on Obj<
Splits the string, converts its parts, and combines them into a new string.String> , provided by the ObjStringExt extension -
startsWith(
Pattern pattern, [int index = 0]) → bool -
Available on Obj<
Whether this string starts with a match ofString> , provided by the ObjStringExt extensionpattern
. -
substring(
int start, [int? end]) → String -
Available on Obj<
The substring of this string fromString> , provided by the ObjStringExt extensionstart
, inclusive, toend
, exclusive. -
toLowerCase(
) → String -
Available on Obj<
Converts all characters in this string to lower case.String> , provided by the ObjStringExt extension -
toUpperCase(
) → String -
Available on Obj<
Converts all characters in this string to upper case.String> , provided by the ObjStringExt extension -
trim(
) → String -
Available on Obj<
The string without any leading and trailing whitespace.String> , provided by the ObjStringExt extension -
trimLeft(
) → String -
Available on Obj<
The string without any leading whitespace.String> , provided by the ObjStringExt extension -
trimRight(
) → String -
Available on Obj<
The string without any trailing whitespace.String> , provided by the ObjStringExt extension
Operators
-
operator *(
int times) → String -
Available on Obj<
Creates a new string by concatenating this string with itself a number of times.String> , provided by the ObjStringExt extension -
operator +(
Obj< String> other) → String -
Available on Obj<
Creates a new string by concatenating this string withString> , provided by the ObjStringExt extensionother
. -
operator [](
int index) → String -
Available on Obj<
The character (as a single-code-unit String) at the givenString> , provided by the ObjStringExt extensionindex
.