MiscExtensions extension

on

Properties

capitalize String?

Available on String?, provided by the MiscExtensions extension

Capitalizes the string in normal form.
no setter
countWords int?

Available on String?, provided by the MiscExtensions extension

Returns the word count in the given string.
no setter
firstWord String?

Available on String?, provided by the MiscExtensions extension

input = aditya pratama | output = aditya
no setter
initialName String

Available on String?, provided by the MiscExtensions extension

input = aditya pratama | output = AP
no setter
isDate bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is valid Date:
no setter
isIpv4 bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is valid IPv4.
no setter
isIpv6 bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is valid IPv6.
no setter
isMail bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is a valid mail.
no setter
isNumber bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is a number.
no setter
isStrongPassword bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is a "strong" password which complies to below rules :
no setter
isUrl bool?

Available on String?, provided by the MiscExtensions extension

Checks whether the String is valid URL.
no setter
lastWord String?

Available on String?, provided by the MiscExtensions extension

input = aditya pratama | output = pratama
no setter
onlyAlfabet String?

Available on String?, provided by the MiscExtensions extension

Returns only the Latin characters from the String.
no setter
onlyNumbers String?

Available on String?, provided by the MiscExtensions extension

Returns only the numbers from the String.
no setter
removeLetters String?

Available on String?, provided by the MiscExtensions extension

Removes only the letters from the String.
no setter
reverse String?

Available on String?, provided by the MiscExtensions extension

Returns the String reversed.
no setter
stripHtml String?

Available on String?, provided by the MiscExtensions extension

Strips all HTML code from String.
no setter
toCamelCase String?

Available on String?, provided by the MiscExtensions extension

Returns the String in camelcase.
no setter
toSlug String?

Available on String?, provided by the MiscExtensions extension

Returns the string to slug case.
no setter
toTitleCase String?

Available on String?, provided by the MiscExtensions extension

Returns the word title cased.
no setter
trimAll String?

Available on String?, provided by the MiscExtensions extension

Trims leading and trailing spaces, so as extra spaces in between words.
no setter

Methods

allAfter(Pattern pattern) String

Available on String?, provided by the MiscExtensions extension

Searches the string for the first occurrence of a pattern and returns everything after that occurrence.
allBefore(Pattern pattern) String

Available on String?, provided by the MiscExtensions extension

Searches the string for the last occurrence of a pattern and returns everything before that occurrence.
allBetween(Pattern startPattern, Pattern endPattern) String

Available on String?, provided by the MiscExtensions extension

Searches the string for the first occurrence of startPattern and the last occurrence of endPattern. It returns the string between that occurrences.
charCount(String char) int?

Available on String?, provided by the MiscExtensions extension

Finds a specific's character occurence in a string.
first({int n = 1}) String?

Available on String?, provided by the MiscExtensions extension

Returns the first n characters of the string.
last({int n = 1}) String?

Available on String?, provided by the MiscExtensions extension

Returns the last n characters of the string.
maxChars(int n) String?

Available on String?, provided by the MiscExtensions extension

Trims the String to have maximum n characters.
maxLength(int length) String?

Available on String?, provided by the MiscExtensions extension

maxWords(int maxWords) String?

Available on String?, provided by the MiscExtensions extension

readTime({int wordsPerMinute = 200}) int?

Available on String?, provided by the MiscExtensions extension

Returns the average read time duration of the given String in seconds.
removeFirst(int n) String?

Available on String?, provided by the MiscExtensions extension

Removes the first n characters of the String.
removeLast(int n) String?

Available on String?, provided by the MiscExtensions extension

Removes the last n characters of the String.
toDouble() double?

Available on String?, provided by the MiscExtensions extension

Converts a string todouble if possible.
toInt() int?

Available on String?, provided by the MiscExtensions extension

Converts a string toint if possible.
toNum() num?

Available on String?, provided by the MiscExtensions extension

Converts a string to a numeric value if possible.
truncate(int length) String?

Available on String?, provided by the MiscExtensions extension

Truncates a String with more than length characters.
truncateMiddle(int maxChars) String?

Available on String?, provided by the MiscExtensions extension

Truncates a long String in the middle while retaining the beginning and the end.