MiscExtensions extension Null safety

on

Methods

capitalize() String?
Capitalizes the string in normal form. [...]
charCount(String char) int?
Finds a specific's character occurence in a string [...]
charOccurences() List<Map<String, int>>?
Finds all character ooccurences and returns count as: [...]
countWords() int?
Returns the word count in the given string. [...]
findPattern({required String pattern}) List<int>?
Given a pattern returns the starting indices of all occurences of the pattern in the string. [...]
first({int n = 1}) String?
Returns the first n characters of the string. [...]
formatWithMask(String mask) String?
Inspired from Vincent van Proosdij Formats a String with a specific mask [...]
getLevenshtein(String b) int?
The Levenshtein distance between two words is the minimum number of single-character [...]
hasSameCharacters() bool?
Checks if the string is consisted of same characters (ignores cases). [...]
ifEmpty(Function act) String?
If the provided string is empty do something. [...]
isDate() bool?
Checks whether the String is valid Date: [...]
isGreek() bool?
Checks if the String has only Greek characters. [...]
isGuid() bool?
Checks whether the String is a valid Guid. [...]
isIn(Iterable<String> strings) bool?
Checks if the String exists in a given Iterable<String> [...]
isIpv4() bool?
Checks whether the String is valid IPv4. [...]
isIpv6() bool?
Checks whether the String is valid IPv6. [...]
isLatin() bool?
Checks if the String has only Latin characters. [...]
isMail() bool?
Checks whether the String is a valid mail. [...]
isNumber() bool?
Checks whether the String is a number. [...]
isStrongPassword() bool?
Checks whether the String is a "strong" password which complies to below rules : [...]
isUrl() bool?
Checks whether the String is valid URL. [...]
last({int n = 1}) String?
Returns the last n characters of the string. [...]
mostFrequent() String?
Finds the most frequent character in the String. [...]
onlyGreek() String?
Returns only the latin characters from the String. [...]
onlyLatin() String?
Returns only the latin characters from the String. [...]
onlyNumbers() String?
Returns only the numbers from the String. [...]
readTime({int wordsPerMinute = 200}) int?
Returns the average read time duration of the given String in seconds. [...]
removeLetters() String?
Removes only the letters from the String. [...]
removeNumbers() String?
Removes only the numbers from the String. [...]
repeat(int count) String?
Repeats a string count times. [...]
replaceGreek() String?
Replaces all greek words with latin. Comes handy when you want to normalize text for search. [...]
reverse() String?
Returns the String reversed. [...]
shuffle() String?
Shuffles the given string characters. [...]
squeeze(String char) String?
Squeezes the string by removing repeats of a given character. [...]
stripHtml() String?
Strips all HTML code from String. [...]
toArray() List<String>?
Returns a list of the string's characters. [...]
toCamelCase() String?
Returns the String in camelcase. [...]
toDouble() double?
Converts a string todouble if possible. [...]
toInt() int?
Converts a string toint if possible. [...]
toNum() num?
Converts a string to a numeric value if possible. [...]
toSlug() String?
Returns the string to slug case. [...]
toTitleCase() String?
Returns the word title cased. [...]

Operators

operator <(String s) bool?
Checks if the length! of the String is less than s
operator <=(String s) bool?
Checks if the length! of the String is less or equal to s
operator >(String s) bool?
Checks if the length! of the String is more than s
operator >=(String s) bool?
Checks if the length! of the String is more or equal to s