StringAnalysisExtensions extension

Extensions on String for validation, comparison, and analysis.

on

Properties

hasInvalidUnicode bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string contains invalid Unicode characters.
no setter

Methods

containsIgnoreCase(String? other) bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string contains other in a case-insensitive manner.
count(String find) int

Available on String, provided by the StringAnalysisExtensions extension

Returns the number of non-overlapping occurrences of find in this string.
endsWithAny(List<String> find) bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string ends with any character in find.
endsWithPunctuation() bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string ends with punctuation (., ?, or !).
extractCurlyBraces() List<String>?

Available on String, provided by the StringAnalysisExtensions extension

Extracts all text within curly braces from this string.
getFirstDiffChar(String other) String

Available on String, provided by the StringAnalysisExtensions extension

Returns the first character where this string and other differ, or an empty string if they are identical.
hasAnyDigits() bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string contains any digit characters.
isAny(List<String> list) bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string equals any item in list.
isEquals(String? other, {bool ignoreCase = true, bool normalizeApostrophe = true}) bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string equals other, with options for case-insensitivity via ignoreCase and apostrophe normalization via normalizeApostrophe.
isLatin() bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this string contains only Latin alphabet characters (a-z, A-Z).
isVowel() bool

Available on String, provided by the StringAnalysisExtensions extension

Returns true if this single-character string is a vowel.
obscureText({String char = '•', int obscureLength = 3}) String?

Available on String, provided by the StringAnalysisExtensions extension

Returns an obscured version of this string using char repeated, or null if empty.
removeInvalidUnicode() String

Available on String, provided by the StringAnalysisExtensions extension

Returns a new string with all invalid Unicode replacement characters removed.
secondIndex(String char) int

Available on String, provided by the StringAnalysisExtensions extension

Returns the index of the second occurrence of char, or -1 if not found.