StringUtils class
StringUtils
is a utility class in Dart that provides static methods
for manipulating and analyzing strings. This class cannot be instantiated.
The methods in this class include, but are not limited to, methods for checking string equality, converting strings to different cases, checking if a string is empty or null, and so on.
Example usage:
String str = 'Hello, World!';
bool isEmpty = StringUtils.isEmpty(str); // returns false
String upper = StringUtils.toUpperCase(str); // returns 'HELLO, WORLD!'
Note: All methods in this class are null-safe, meaning they will not throw an exception if the input string is null. Instead, they will return a reasonable default value (usually null or false, depending on the method).
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getNthLatinLetterLower(
int n) → String? - Returns the n-th letter of the alphabet in lowercase.
-
getNthLatinLetterUpper(
int n) → String? - Returns the n-th letter of the alphabet in uppercase.