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 = adityano setter - initialName → String
-
Available on String?, provided by the MiscExtensions extension
input = aditya pratama | output = APno 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 = pratamano 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 apattern
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 apattern
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 ofstartPattern
and the last occurrence ofendPattern
. 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 firstn
characters of the string. -
last(
{int n = 1}) → String? -
Available on String?, provided by the MiscExtensions extension
Returns the lastn
characters of the string. -
maxChars(
int n) → String? -
Available on String?, provided by the MiscExtensions extension
Trims theString
to have maximumn
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 firstn
characters of theString
. -
removeLast(
int n) → String? -
Available on String?, provided by the MiscExtensions extension
Removes the lastn
characters of theString
. -
toDouble(
) → double? -
Available on String?, provided by the MiscExtensions extension
Converts astring
todouble
if possible. -
toInt(
) → int? -
Available on String?, provided by the MiscExtensions extension
Converts astring
toint
if possible. -
toNum(
) → num? -
Available on String?, provided by the MiscExtensions extension
Converts astring
to a numeric value if possible. -
truncate(
int length) → String? -
Available on String?, provided by the MiscExtensions extension
Truncates aString
with more thanlength
characters. -
truncateMiddle(
int maxChars) → String? -
Available on String?, provided by the MiscExtensions extension
Truncates a longString
in the middle while retaining the beginning and the end.