StringExtension extension

String extensions to get basic functionality on strings

on

Properties

countWord int
Counts the number of words in
no setter
isAlphabet bool
Checks string is letter or not and return bool
no setter
isAlphaNumeric bool
Checks string is Alpha Numerical or not and return bool
no setter
isAudio bool
check string is audio
no setter
isCapital bool
check string is in capital case or not
no setter
isCsv bool
Check file is csv or not
no setter
isEmail bool
Checks if string is email.
no setter
isImage bool
check string is image
no setter
isJpg bool
Check image is jpg or jpeg or not
no setter
isLower bool
check string is in lower case or not
no setter
isNumber bool
Checks string is Number or not and return bool
no setter
isPDF bool
Check file is pdf or not
no setter
isPng bool
Check image is png or not
no setter
isSentence bool
check string is in Sentence case or not
no setter
isSvg bool
Check image is svg or not
no setter
isTitle bool
check string is in Title case or not
no setter
isTxt bool
Check file is text or not
no setter
isUpper bool
check string is in upper case or not
no setter
isURL bool
Checks if string is URL.
no setter
isVideo bool
check string is video
no setter
occurrences Map<String, int>
Counts the number of occurrences of string
no setter
removeWhitespace String
Removes all whitespace
no setter
toCapitalCase String
Converts all characters in this string to capital case.
no setter
toDouble double?
Convert string to double
no setter
toInt int?
Convert string to int
no setter
toSentenceCase String
Capitalize first letter of String and convert rest of string into lower case
no setter
toSlug String
Convert string into slug
no setter
toTitleCase String
Converts all first characters in this string to capital case and rest to the lower case.
no setter

Methods

append(String string) String
append to start string
concat(String concat) String
Concatenate string with whitespace
countOccurrence(String string) int
Counts the number of occurrences of value.
ifEmpty([String value = 'null']) String
Get default value if string is empty.
inRange(int min, int max) bool
Check this string length between minLen & maxLen, if satisfied condition then return true
mask({int upto = 4, String mask = '*', bool atEnd = false}) String?
Replaces all but the last num runes of a string with the specified mask.
maxLen(int max) bool
Check this string max length, if satisfied condition then return true
minLen(int min) bool
Check this string min length, if satisfied condition then return true
prepend(String string) String
prepend to start string
regex(String source) bool
match string with regex pattern
removeFirst([int? upto]) String
Remove first element of string
removeLast([int upto = 1]) String
Remove last element of string

Static Methods

isBool(String value) bool
Checks if string is boolean.