StringExtensions extension
- on
Properties
- camelCase → String?
-
Available on String, provided by the StringExtensions extension
camelCase string Example: your name => yourNameno setter - capitalize → String
-
Available on String, provided by the StringExtensions extension
Capitalizes the first letter of each word in the string.no setter - capitalizeAllWordsFirstLetter → String
-
Available on String, provided by the StringExtensions extension
Capitalize only the first letter of each word in a stringno setter - capitalizeEach → String
-
Available on String, provided by the StringExtensions extension
Capitalizes the first letter of each word in the string.no setter - capitalizeFirst → String
-
Available on String, provided by the StringExtensions extension
Capitalizes the first letter of the string.no setter - containsEmoji → bool
-
Available on String, provided by the StringExtensions extension
Returnstrue
if this string contains at least one emoji character.no setter - containsOnlyEmojis → bool
-
Available on String, provided by the StringExtensions extension
Checks if the string contains only emojis.no setter - containsOnlyOneEmoji → bool
-
Available on String, provided by the StringExtensions extension
Checks if the string contains only one emoji.no setter - hasCapitalLetter → bool
-
Available on String, provided by the StringExtensions extension
Checks if string contains at least one Capital Letterno setter - hasEmojis → bool
-
Available on String, provided by the StringExtensions extension
Checks if the string contains any emojis.no setter - isAlphabetic → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains only letters (a-zA-Z).no setter - isAlphabetOnly → bool
-
Available on String, provided by the StringExtensions extension
Checks if string consist only Alphabet. (No Whitespace)no setter - isAlphanumeric → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains only letters and numbersno setter - isAPK → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an apk file.no setter - isAscii → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains ASCII chars onlyno setter - isAudio → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an audio file.no setter - isBase64 → bool
-
Available on String, provided by the StringExtensions extension
Check if a string is base64 encodedno setter - isBinary → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is binary.no setter - isBool → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is boolean.no setter - isChm → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an chm file.no setter - isCnpj → bool
-
Available on String, provided by the StringExtensions extension
no setter - isCpf → bool
-
Available on String, provided by the StringExtensions extension
Checks if the cpf is valid.no setter - isCreditCard → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is a credit cardno setter - isCurrency → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is Currency.no setter - isDate → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is a dateno setter - isDateTime → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is DateTime (UTC or Iso8601).no setter - isEmail → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is email.no setter - isExcel → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an excel file.no setter - isFloat → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is a floatno setter - isFullWidth → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains any full-width charsno setter - isHalfWidth → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains any half-width charsno setter - isHexadecimal → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is a hexadecimal numberno setter - isHexColor → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is a hexadecimal colorno setter - isHTML → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an html file.no setter - isImage → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an image file.no setter - isInt → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is an integerno setter - isIPv4 → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is IPv4.no setter - isIPv6 → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is IPv6.no setter - isJson → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is valid JSONno setter - isLocalFile → bool
-
Available on String, provided by the StringExtensions extension
Checks if the string represents a local file path.no setter - isLowercase → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is lowercaseno setter - isMD5 → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is MD5 hash.no setter - isMemoryImage → bool
-
Available on String, provided by the StringExtensions extension
Checks if the string represents a base64 encoded image.no setter - isMongoId → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is a valid hex-encoded representation of a MongoDB ObjectIdno setter - isMultibyte → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains one or more multibyte charsno setter - isNum → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is int or double.no setter - isNumeric → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a number type ofdouble
orint
no setter - isNumericOnly → bool
-
Available on String, provided by the StringExtensions extension
Checks if string consist only numeric. Numeric only doesn't accepting "." which double data type haveno setter - isOneAKind → bool
-
Available on String, provided by the StringExtensions extension
Checks if all data have same value.no setter - isPalindrome → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is Palindrome.no setter - isPassport → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is Passport No.no setter - isPDF → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an pdf file.no setter - isPhoneNumber → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is phone number.no setter - isPPT → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an powerpoint file.no setter - isSHA1 → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is SHA1 hash.no setter - isSHA256 → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is SHA256 hash.no setter - isSSN → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is SSN (Social Security Number).no setter - isSurrogatePair → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains any surrogate pairs charsno setter - isTxt → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an txt file.no setter - isUppercase → bool
-
Available on String, provided by the StringExtensions extension
Check if the string is uppercaseno setter - isURL → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is URL.no setter - isUsername → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a valid username.no setter - isVariableWidth → bool
-
Available on String, provided by the StringExtensions extension
Check if the string contains a mixture of full and half-width charsno setter - isVector → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a vector file.no setter - isVideo → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an video file.no setter - isWord → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is an word file.no setter - mimeType → String
-
Available on String, provided by the StringExtensions extension
Determines the MIME type of the file based on its extension.no setter - paramCase → String
-
Available on String, provided by the StringExtensions extension
param-caseno setter - removeAllWhitespace → String
-
Available on String, provided by the StringExtensions extension
Remove all whitespace inside stringno setter - withAorAn → String
-
Available on String, provided by the StringExtensions extension
Returns "an" before the string if it starts with a vowel, otherwise "a".no setter
Methods
-
blacklist(
String chars) → String -
Available on String, provided by the StringExtensions extension
Removes characters that appear in the blacklist. -
containsIgnoreCase(
String value) → bool -
Available on String, provided by the StringExtensions extension
Containsvalue
with case-insensitive -
createPath(
[Iterable? segments]) → String -
Available on String, provided by the StringExtensions extension
Create a path with the given segments. -
equals(
String other) → bool -
Available on String, provided by the StringExtensions extension
Case equality check. -
equalsAll(
List< String> values, {bool isLowerCase = false, bool isUpperCase = false, bool isIgnoreCase = false}) → bool -
Available on String, provided by the StringExtensions extension
Checks if string equals all items in the list -
equalsAny(
List< String> values, {bool isLowerCase = false, bool isUpperCase = false, bool isIgnoreCase = false}) → bool -
Available on String, provided by the StringExtensions extension
Checks if string equals any item in the list -
equalsIgnoreCase(
String other) → bool -
Available on String, provided by the StringExtensions extension
Case-insensitive equality check. -
escape(
) → String -
Available on String, provided by the StringExtensions extension
Replaces HTML entities <, >, &, ', and " with their respective HTML entities. -
first(
[int count = 1]) → String -
Available on String, provided by the StringExtensions extension
Returns the firstcount
characters of the string. Ifcount
exceeds the string length, it returns the whole string. If the string is empty or null, it returns an empty string. -
formatted(
[Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6, Object? arg7, Object? arg8]) → String -
Available on String, provided by the StringExtensions extension
Formats the string with the given arguments. -
getFileName(
{bool withMimeType = false, bool appendMimeType = true}) → String -
Available on String, provided by the StringExtensions extension
Extracts the file name from a path, URL, or asset. -
isAfter(
[String? date]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is a date that's after the specified date -
isBefore(
[String? date]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is a date that's before the specified date -
isByteLength(
int min, [int? max]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string's length (in bytes) falls in a range. -
isCaseInsensitiveContains(
String b) → bool -
Available on String, provided by the StringExtensions extension
Checks if a contains b (Treating or interpreting upper- and lowercase letters as being the same). -
isCaseInsensitiveContainsAny(
String b) → bool -
Available on String, provided by the StringExtensions extension
Checks if a contains b or b contains a (Treating or interpreting upper- and lowercase letters as being the same). -
isDivisibleBy(
Object n) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is a number that's divisible by another -
isEqualTo(
String other) → bool -
Available on String, provided by the StringExtensions extension
Case equality check. -
isFQDN(
[Map< String, Object> ? options]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is a fully qualified domain name (e.g. domain.com). -
isIn(
Object? values) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is in an array of allowed values -
isIP(
[Object? version]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is an IP (version 4 or 6) -
isISBN(
[Object? version]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is an ISBN (version 10 or 13) -
isLength(
int min, [int? max]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string's length falls in a range If no max is given then any length above min is ok. -
isNotEqualTo(
String other) → bool -
Available on String, provided by the StringExtensions extension
Case in-equality check. -
isUrl(
[Map< String, Object> ? options]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is a URL -
isUUID(
[Object? version]) → bool -
Available on String, provided by the StringExtensions extension
Check if the string is a UUID (version 3, 4 or 5). -
leftTrim(
[String? chars]) → String -
Available on String, provided by the StringExtensions extension
Trims characters from the left side of the string. -
matchesRegex(
String pattern) → bool -
Available on String, provided by the StringExtensions extension
-
normalizeEmail(
[Map< String, Object> ? options]) → String -
Available on String, provided by the StringExtensions extension
Canonicalizes an email address. Options include lowercase and specific provider rules. -
notEquals(
String other) → bool -
Available on String, provided by the StringExtensions extension
Case in-equality check. -
notEqualsAll(
List< String> values, {bool isLowerCase = false, bool isUpperCase = false, bool isIgnoreCase = false}) → bool -
Available on String, provided by the StringExtensions extension
Checks if string does not equals all items in the list -
notEqualsAny(
List< String> values, {bool isLowerCase = false, bool isUpperCase = false, bool isIgnoreCase = false}) → bool -
Available on String, provided by the StringExtensions extension
Checks if string does not equals any item in the list -
notEqualsIgnoreCase(
String other) → bool -
Available on String, provided by the StringExtensions extension
Case-insensitive in-equality check. -
numericOnly(
{bool firstWordOnly = false}) → String -
Available on String, provided by the StringExtensions extension
Extract numeric value of string Example: OTP 12312 27/04/2020 => 1231227042020ß If firstWordOnly is true, then the example return is "12312" (first found numeric word) -
removeEmojis(
{bool collapseSpaces = true, String replacement = '', RegExp? regex}) → String -
Available on String, provided by the StringExtensions extension
Returns a new string with all emojis removed, including any leading or trailing whitespace around the emojis, to avoid leftover gaps in the text. -
replaceAllToLowerCase(
Pattern pattern, String replace) → String -
Available on String, provided by the StringExtensions extension
Replaces all occurrences of the given pattern with the specified replacement and returns the result in lowercase. -
replaceAllToUpperCase(
Pattern pattern, String replace) → String -
Available on String, provided by the StringExtensions extension
Replaces all occurrences of the given pattern with the specified replacement and returns the result in uppercase. -
replaceAllWithOriginalCase(
Pattern pattern, String replace) → String -
Available on String, provided by the StringExtensions extension
Replaces all occurrences of the given pattern with the specified replacement and returns the result as a String. -
replaceToLowerCase(
Pattern pattern, String replace) → String -
Available on String, provided by the StringExtensions extension
Replaces the first occurrence of the given pattern with the specified replacement and returns the result in lowercase. -
replaceToUpperCase(
Pattern pattern, String replace) → String -
Available on String, provided by the StringExtensions extension
Replaces the first occurrence of the given pattern with the specified replacement and returns the result in uppercase. -
replaceWithOriginalCase(
Pattern pattern, String replace) → String -
Available on String, provided by the StringExtensions extension
Replaces the first occurrence of the given pattern with the specified replacement and returns the result as a String. -
rightTrim(
[String? chars]) → String -
Available on String, provided by the StringExtensions extension
Trims characters from the right side of the string. -
snakeCase(
{String separator = '_'}) → String -
Available on String, provided by the StringExtensions extension
snake_case -
stripLow(
[bool keepNewLines = false]) → String -
Available on String, provided by the StringExtensions extension
Removes characters with a numerical value less than 32 and 127. IfkeepNewLines
is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -
toBool(
[bool strict = false]) → bool -
Available on String, provided by the StringExtensions extension
Converts the string to a bool.strict
mode only allows '1' and 'true' to return true. -
toDate(
) → DateTime? -
Available on String, provided by the StringExtensions extension
Converts the string to a DateTime object. Returns null if parsing fails. -
toDouble(
) → double -
Available on String, provided by the StringExtensions extension
Converts the string to a double. Returns NaN if parsing fails. -
toFloat(
) → double -
Available on String, provided by the StringExtensions extension
Converts the string to a double. Returns NaN if parsing fails. -
toInt(
{int radix = 10}) → num -
Available on String, provided by the StringExtensions extension
Converts the string to a num.radix
is the base for integer parsing. -
whitelist(
String chars) → String -
Available on String, provided by the StringExtensions extension
Removes characters that do not appear in the whitelist.