TextUtils class
文本工具类
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
-
currencyFormat(
int money) → String -
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
-
abbreviate(
String? str, int maxWidth, {int offset = 0}) → String? - 使用点缩写字符串
-
compare(
String str1, String str2) → int - 比较两个字符串是否相同
-
contains(
String str, Pattern searchPattern, [int startIndex = 0]) → bool - 判断字符串中是否包含xx
-
containsAny(
String str, List< Pattern> searchPatterns, [int startIndex = 0]) → bool - 判断一个字符串是否包含任何给定的搜索模式
-
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位加空格
-
hammingDistance(
String str1, String str2) → int - 比较两个长度一样的字符串有几个字符不同
-
hideNumber(
String phoneNo, {int start = 3, int end = 7, String replacement = '****'}) → String - 隐藏手机号中间n位
-
isEmpty(
String? text) → bool - 判断文本内容是否为空
-
isNotEmpty(
String text) → bool - 判断文本内容是否不为空
-
replace(
String text, Pattern from, String replace) → String - 替换字符串中的数据
-
reverse(
String text) → String - 反转字符串
-
split(
String text, Pattern pattern) → List< String> - 按照正则切割字符串
-
startsWith(
String str, Pattern prefix, [int index = 0]) → bool - 判断字符串是以xx开头
-
startsWithAny(
String str, List< Pattern> prefixes, [int index = 0]) → bool - 判断一个字符串以任何给定的前缀开始