StringExtension extension
- on
Properties
- isApk → bool
-
Document regex
no setter
- isAudio → bool
-
Audio regex
no setter
- isDoc → bool
-
Document regex
no setter
- isEmptyOrNull → bool
-
Returns true if given String is null or isEmpty
no setter
- isExcel → bool
-
Excel regex
no setter
- isHtml → bool
-
HTML regex
no setter
- isImage → bool
-
Image regex
no setter
- isInt → bool
-
no setter
- isPdf → bool
-
PDF regex
no setter
- isPPT → bool
-
PPT regex
no setter
- isTxt → bool
-
Txt regex
no setter
- isVideo → bool
-
Video regex
no setter
- renderHtml → String
-
Render a HTML String
no setter
- reverse → String
-
It reverses the String
no setter
Methods
-
calculateReadTime(
{int wordsPerMinute = 200}) → double - Return average read time duration of given String in seconds
-
capitalizeEachWord(
) → String - This function returns given string with each word capital
-
capitalizeFirstLetter(
) → String - Capitalize given String
-
convertYouTubeUrlToId(
{bool trimWhitespaces = true}) → String - Get YouTube Video ID
-
copyToClipboard(
) → Future< void> -
countWords(
) → int - Return number of words ina given String
-
formatNumberWithComma(
{String seperator = ','}) → String - for ex. add comma in price
-
getBoolInt(
) → bool - Returns true if given value is '1', else returns false
-
getNumericOnly(
{bool aFirstWordOnly = false}) → String - Returns only numbers from a string trim Whitespaces
-
getYouTubeThumbnail(
{bool trimWhitespaces = true}) → String - Returns YouTube thumbnail for given video id
-
isAlpha(
) → bool - Check weather String is alpha or not
-
isDigit(
) → bool - Return true if given String is Digit
-
isJson(
) → bool -
prefixText(
{required String value}) → String - eg. Text("Dr. ${VARIABLE_NAME}"); => Text("VARIABLE_NAME.prefixText("Dr.")");
-
removeAllWhiteSpace(
) → String - Removes white space from given String
-
repeat(
int n, {String separator = ''}) → String - Returns the given string n times
-
setSearchParam(
) → List< String> - returns searchable array for Firebase Database
-
splitAfter(
Pattern pattern) → String -
Splits from a
pattern
and returns remaining String after that -
splitBefore(
Pattern pattern) → String -
Splits from a
pattern
and returns String before that -
splitBetween(
Pattern startPattern, Pattern endPattern) → String -
It matches the String and returns between
startPattern
andendPattern
-
suffixText(
{required String value}) → String - eg. Text("${VARIABLE_NAME} /-"); => Text("VARIABLE_NAME.suffixText("/-")");
-
toastString(
) → void - toast a String
-
toBool(
) → bool - Returns true if the validate() method returns 'true', otherwise returns false.
-
toColor(
{Color? defaultColor}) → Color - Get Color from HEX String
-
toDouble(
{double defaultValue = 0.0}) → double - Return double value of given string
-
toInt(
{int defaultValue = 0}) → int - Return int value of given string
-
toList(
) → List< String> - It return list of single character from String
-
toSlug(
{String delimiter = '_'}) → String - Generate slug of a given String
-
toYouTubeId(
{bool trimWhitespaces = true}) → String - Get YouTube Video ID
-
validate(
{String value = ''}) → String -
validateEmail(
) → bool - Check email validation
-
validateEmailEnhanced(
) → bool - Check email validation
-
validatePhone(
) → bool - Check phone validation
-
validateURL(
) → bool - Check URL validation