StringExt extension
- on
Methods
-
format(
List params) → String - Replace all occurrences of {index} with the corresponding parameter..
-
formatWith(
dynamic provider(String key)) → String -
Available on String, provided by the StringExt extension
Replaces all occurrences of{key}with the value returned byprovider. Ifproviderreturnsnull, the original string is used. -
formatWithMap(
Map< String, dynamic> params) → String -
Available on String, provided by the StringExt extension
Replaces all occurrences of{key}with the value fromparamswith the corresponding key. Ifparamsdoes not contain a value for a key, the original string is used. Example: -
formatWithParameterized(
dynamic provider(String key, List< String> params)) → String -
Available on String, provided by the StringExt extension
Replaces all occurrences of{key|param1|param2|...}with the value returned byprovider. Ifproviderreturnsnull, the original string is used. The parameters are passed as a list toprovider. Example: -
padBoth(
int width, [String padding = ' ']) → String -
Available on String, provided by the StringExt extension
Returns a string with the givenwidthby padding it withpadding. If the string is already longer thanwidth, it is returned unchanged. If the padding cannot be evenly distributed on both sides, the right side gets the extra padding.