StringExtensions extension
- on
Properties
- asBool → bool
-
Available on String?, provided by the StringExtensions extension
Convert this string into boolean.no setter - getTextSize → Size
-
Available on String?, provided by the StringExtensions extension
no setter - isEmptyOrNull → bool
-
Available on String?, provided by the StringExtensions extension
Return a bool if the string is null or emptyno setter - isNotBlank → bool
-
Available on String?, provided by the StringExtensions extension
Returns true if s is neither null, empty nor is solely made of whitespace characters.no setter - isNullOrWhiteSpace → bool
-
Available on String?, provided by the StringExtensions extension
Indicates whether a specified string isnull
,empty
, or consists only ofwhite-space
characters.no setter - lastIndex → String
-
Available on String?, provided by the StringExtensions extension
no setter - orEmpty → String
-
Available on String?, provided by the StringExtensions extension
Returns the string if it is notnull
, or the empty string otherwiseno setter
Methods
-
anyChar(
bool predicate(String element)) → bool -
Available on String?, provided by the StringExtensions extension
Returnstrue
if at least one element matches the givenpredicate
. thepredicate
should have only one character -
equalsIgnoreCase(
String? other) → bool -
Available on String?, provided by the StringExtensions extension
-
generateMessageByGender(
{Gender? gender, Message? message}) → String -
Available on String?, provided by the StringExtensions extension
-
hasCapitalletter(
String s) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string contains at least one Capital Letter -
hasMatch(
String? value, String pattern) → bool -
Available on String?, provided by the StringExtensions extension
-
ifEmpty(
Function action) → String? -
Available on String?, provided by the StringExtensions extension
-
insert(
int index, String str) → String -
Available on String?, provided by the StringExtensions extension
Returns a new string in which a specified string is inserted at a specified index position in this instance. -
isAlphabetOnly(
String s) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string consist only Alphabet. (No Whitespace) -
isAudio(
String filePath) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is an audio file. -
isBlank(
dynamic value) → bool? -
Available on String?, provided by the StringExtensions extension
Checks if data is null or blank (empty or only contains whitespace). -
isBool(
String value) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is boolean. -
isCurrency(
String s) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is Currency. -
isEmail(
String s) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is email. -
isHTML(
String filePath) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is an html file. -
isImage(
String filePath) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is an image file. -
isNull(
dynamic value) → bool -
Available on String?, provided by the StringExtensions extension
-
isNumericOnly(
String s) → dynamic -
Available on String?, provided by the StringExtensions extension
-
isPalindrom(
String string) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is Palindrom. -
isPhoneNumber(
String s) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is phone number. -
isUsername(
String s) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is a valid username. -
isVideo(
String filePath) → bool -
Available on String?, provided by the StringExtensions extension
Checks if string is an video file. -
limitFromEnd(
int maxSize) → String? -
Available on String?, provided by the StringExtensions extension
Shrink a string to be no more thanmaxSize
in length, extending from the end. For example, in a string with 10 charachters, amaxSize
of 3 would return the last 3 charachters. -
limitFromStart(
int maxSize) → String? -
Available on String?, provided by the StringExtensions extension
Shrink a string to be no more thanmaxSize
in length, extending from the start. For example, in a string with 10 charachters, amaxSize
of 3 would return the first 3 charachters. -
printThis(
) → void -
Available on String?, provided by the StringExtensions extension
prints to console this text if it's not empty or null -
removeAllWhiteSpace(
) → String? -
Available on String?, provided by the StringExtensions extension
Returns a String without white space at all "hello world" // helloworld -
removeSurrounding(
String delimiter) → String? -
Available on String?, provided by the StringExtensions extension
Return the string only if the delimiter exists in both ends, otherwise it will return the current string -
replaceAfter(
String delimiter, String replacement, [String? defaultValue]) → String? -
Available on String?, provided by the StringExtensions extension
Replace part of string after the first occurrence of given delimiter with thereplacement
string. If the string does not contain the delimiter, returnsdefaultValue
which defaults to the original string. -
replaceBefore(
String delimiter, String replacement, [String? defaultValue]) → String? -
Available on String?, provided by the StringExtensions extension
Replace part of string before the first occurrence of given delimiter with thereplacement
string. If the string does not contain the delimiter, returnsmissingDelimiterValue?
which defaults to the original string. -
toCharArray(
) → List< String> -
Available on String?, provided by the StringExtensions extension
Returns a list of chars from a String -
toDoubleOrNull(
) → double? -
Available on String?, provided by the StringExtensions extension
Parses the string as an double or returnsnull
if it is not a number. -
toIntOrNull(
) → int? -
Available on String?, provided by the StringExtensions extension
Parses the string as an int or returnsnull
if it is not a number. -
validateEmail(
) → bool -
Available on String?, provided by the StringExtensions extension
-
wrapString(
int afterWords) → String -
Available on String?, provided by the StringExtensions extension
afterWords
will add new line after the selected word Example 'Hi, my name is'.wrapString(2)