StringExtensions extension

Provides extended methods for String.

String用の拡張メソッドを提供します。

on

Methods

capitalize() String

Available on String, provided by the StringExtensions extension

Captialize and return String.
first({String separator = "/"}) String

Available on String, provided by the StringExtensions extension

Divides a String by separator and returns the first part.
format(List<Object> arg) String

Available on String, provided by the StringExtensions extension

Replaces String with the C printf format.
fromAES(String key) String

Available on String, provided by the StringExtensions extension

Decrypts AES-encrypted and Base64-encoded String.
fromBase64() String

Available on String, provided by the StringExtensions extension

Decodes Base64-encoded String.
fromBase64Url() String

Available on String, provided by the StringExtensions extension

Decodes Base64URL-encoded String.
isEmail() bool

Available on String, provided by the StringExtensions extension

Returns whether this string is an email address or not.
isEmoji() bool

Available on String, provided by the StringExtensions extension

Returns whether or not this string contains pictograms.
isURL() bool

Available on String, provided by the StringExtensions extension

Returns whether this string is a URL or not.
last({String separator = "/"}) String

Available on String, provided by the StringExtensions extension

Divides a String by separator and returns the last part.
limit(int length, {String suffix = "..."}) String

Available on String, provided by the StringExtensions extension

String with length to limit the number of characters.
parentPath({String separator = "/"}) String

Available on String, provided by the StringExtensions extension

String is divided by separator and moved one level up.
removeOnlyEmoji() String

Available on String, provided by the StringExtensions extension

Removes only emojis from String.
splitByBigram() List<String>

Available on String, provided by the StringExtensions extension

Convert String to Bigram, i.e., an array of two characters each.
splitByCharacter() List<String>

Available on String, provided by the StringExtensions extension

Converts String to an array of one character at a time.
splitByCharacterAndBigram() List<String>

Available on String, provided by the StringExtensions extension

Converts String into a one-character array and a two-character array.
splitByTrigram() List<String>

Available on String, provided by the StringExtensions extension

Convert String to Trigram, i.e., an array of 3 characters each.
splitLength({String separator = "/"}) int

Available on String, provided by the StringExtensions extension

Divides String by separator and returns the number of elements.
toAES(String key) String

Available on String, provided by the StringExtensions extension

Pass key of at least 32 characters to String for AES encryption.
toAny() → dynamic

Available on String, provided by the StringExtensions extension

Converts a String to a type that can be parsed as bool, int, or double, in that order, and returns the type as is.
toBase64() String

Available on String, provided by the StringExtensions extension

Encode String into a Base64 string.
toBase64Url() String

Available on String, provided by the StringExtensions extension

Encode String into a Base64URL string.
toBool([bool defaultValue = false]) bool

Available on String, provided by the StringExtensions extension

Converts String to bool.
toCamelCase() String

Available on String, provided by the StringExtensions extension

Convert String to CamelCase (first letter is lower case).
toDateTime([DateTime? defaultValue]) DateTime

Available on String, provided by the StringExtensions extension

Converts String to DateTime.
toDouble([double defaultValue = 0.0]) double

Available on String, provided by the StringExtensions extension

Converts String to double.
toHankakuNumericAndAlphabet() String

Available on String, provided by the StringExtensions extension

Converts alphabets and numbers to half-width characters.
toHiragana() String

Available on String, provided by the StringExtensions extension

Converts katakana to hiragana.
toInt([int defaultValue = 0]) int

Available on String, provided by the StringExtensions extension

Converts String to int.
toJsonList<T extends Object>([List<T> defaultValue = const []]) List<T>

Available on String, provided by the StringExtensions extension

Converts String to a Json-decoded List<dynamic> object.
toJsonMap<T extends Object>([Map<String, T> defaultValue = const {}]) Map<String, T>

Available on String, provided by the StringExtensions extension

Converts String to a Json-decoded Map<String, dynamic> object.
toJsonObject([Object? defaultValue]) → dynamic

Available on String, provided by the StringExtensions extension

Converts String to a Json-decoded object.
toKatakana() String

Available on String, provided by the StringExtensions extension

Converts hiragana into katakana.
toPascalCase() String

Available on String, provided by the StringExtensions extension

Convert String to Pascal case (first letter capitalized).
toRandomInt() int

Available on String, provided by the StringExtensions extension

Returns a unique random integer from a string.
toSHA1() String

Available on String, provided by the StringExtensions extension

Hash String with SHA1.
toSHA256(String password) String

Available on String, provided by the StringExtensions extension

Give password to String and hash it with HMAC-SHA256.
toSnakeCase() String

Available on String, provided by the StringExtensions extension

Convert String to snake case.
toUri() Uri?

Available on String, provided by the StringExtensions extension

Converts string to Uri.
toZenkakuKatakana() String

Available on String, provided by the StringExtensions extension

Converts half-width katakana to full-width katakana.
toZenkakuNumericAndAlphabet() String

Available on String, provided by the StringExtensions extension

Converts alphabets and numbers to full-width characters.
trimQuery() String

Available on String, provided by the StringExtensions extension

Trims URL query characters (after ?).
trimString(String chars) String

Available on String, provided by the StringExtensions extension

Trims the characters given by chars from before and after String.
trimStringLeft(String chars) String

Available on String, provided by the StringExtensions extension

Trims the characters given by chars from before String.
trimStringRight(String chars) String

Available on String, provided by the StringExtensions extension

Trims the characters given by chars from after String.