TextUtil class
Text Util.
Constructors
- TextUtil()
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
-
addPrefixIfNot(
String? str, String prefix) → String - ------------------------------slc---------------------------------
-
addSuffixIfNot(
String? str, String suffix) → String -
如果给定字符串不是以
suffix结尾的,在尾部补充suffix -
format(
String str, List< Object?> args, {Pattern pattern = '{}'}) → String - 格式化字符串
-
formatComma3(
Object num) → String - 每隔3三位加逗号 num 数字或数字字符串。int型。
-
formatDigitPattern(
String text, {int digit = 4, String pattern = ' '}) → String - 每隔 x位 加 pattern
-
formatDigitPatternEnd(
String text, {int digit = 4, String pattern = ' '}) → String - 每隔 x位 加 pattern, 从末尾开始
-
formatDoubleComma3(
Object num, {int digit = 3, String pattern = ','}) → String - 每隔3三位加逗号 num 数字或数字字符串。double型。
-
formatSpace4(
String text) → String - 每隔4位加空格
-
hideNumber(
String phoneNo, {int start = 3, int end = 7, String replacement = '****'}) → String - hideNumber
-
isEmpty(
String? text) → bool - isEmpty
-
isNotEmpty(
String? text) → bool - isEmpty
-
removePrefix(
String? str, String prefix) → String - 去掉指定前缀
-
removePrefixIgnoreCase(
String? str, String prefix) → String - 忽略大小写去掉指定前缀
-
removeSuffix(
String? str, String suffix) → String - 去掉指定后缀
-
removeSuffixIgnoreCase(
String? str, String suffix) → String - 忽略大小写去掉指定后缀
-
replace(
String? text, Pattern from, String replace) → String? - replace
-
reverse(
String? text) → String - reverse
-
split(
String? text, Pattern pattern) → List< String> - split
Constants
- AMP → const String
- BACKSLASH → const String
- BRACKET_END → const String
- BRACKET_START → const String
- COLON → const String
- COMMA → const String
- CR → const String
- CRLF → const String
- DASHED → const String
- DELIM_END → const String
- DELIM_START → const String
- DOT → const String
- DOUBLE_DOT → const String
- DOUBLE_QUOTES → const String
- EMPTY → const String
- EMPTY_JSON → const String
- GT → const String
- HTML_AMP → const String
- HTML_APOS → const String
- HTML_GT → const String
- HTML_LT → const String
- HTML_NBSP → const String
- HTML_QUOTE → const String
- LF → const String
- LT → const String
- NULL → const String
- SINGLE_QUOTE → const String
- SLASH → const String
- SPACE → const String
- TAB → const String
- UNDERLINE → const String