Flutter——截取字符串大全

使用”${}”打印表达式的值,打印单个变量的值不用加“{}”。

length打印字符串的长度。“isEmpty”判断字符串是否为空。

“contains()是否包含某个字符串”。”substring(startIndex,endIndex)截取一段字符串”。“

startsWith()”是否以某个字符串开头。“endsWith()是否以某个字符串结尾”。

“indexOf()“某个字符串的下标。”lastIndexOf()”最后一次出现某个字符串的下标。”

toLowerCase()“转为小写,”toUpperCase()“转为大写。

“trim()”清除空格。”trimLeft()“清除前边的空格。”trimRight()“清除后边的空格。”

split()“分割字符串。”replace(),replaceAll(‘old’,’new‘)“替换字符串。

推荐链接:https://blog.csdn.net/weixin_35241867/article/details/112044744

 关于split指定截取

原文地址:https://www.cnblogs.com/liuzhi20101016/p/14269663.html