StringUtils class

Helper class for String operations

Constructors

StringUtils()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Properties

asciiCodec ↔ AsciiCodec
read / write

Static Methods

addCharAtPosition(String s, String char, int position, { bool repeat: false }) → String
Add a char at a position with the given String s. [...]
camelCaseToLowerUnderscore(String s) → String
Transfers the given String s from camcelCase to lowerCaseUnderscore Example : helloWorld => hello_world
camelCaseToUpperUnderscore(String s) → String
Transfers the given String s from camcelCase to upperCaseUnderscore Example : helloWorld => HELLO_WORLD
capitalize(String s) → String
Capitalize the given string s Example : world => World, WORLD => World
chunk(String s, int chunkSize) → List<String>
Splits the given String s in chunks with the given chunkSize.
countChars(String s, { String char, { bool caseSensitive: true }) → int
Counts how offen the given char apears in the given string s. The value caseSensitive controlls whether it should only look for the given char or also the equivalent lower/upper case version. Example: Hello and char l => 2
defaultString(String str, { String defaultStr: '' }) → String
Returns the given string or the default string if the given string is null
equalsIgnoreCase(String a String b) → bool
Compares the given strings a and b.
hidePartial(String s, { int begin: 0, int end, String replace: "*" }) → String
Replaces chars of the given String s with replace. [...]
inList(String s, List<String> list, { bool ignoreCase: false }) → bool
Checks if the given list contains the string s
isAscii(String s) → bool
Checks if the given string s contains only ascii chars
isDigit(String s) → bool
Checks if the given string s is a digit. [...]
isLowerCase(String s) → bool
Checks if the given string s is lower case
isNotNullOrEmpty(String s) → bool
Checks if the given String s is not null or empty
isNullOrEmpty(String s) → bool
Checks if the given String s is null or empty
isPalindrome(String s) → bool
Checks if the given string s is a palindrome Example : aha => true hello => false
isUpperCase(String s) → bool
Checks if the given string s is upper case
reverse(String s) → String
Reverse the given string s Example : hello => olleh