小编Cha*_*ige的帖子

Flutter 分割字符串并保持分隔符

在颤振中使用正则表达式分割时如何保留分隔符?

文本:"this is {{A}} sample {{text}} ..."

我想要的是:["this is", "{{A}}", "sample", "{{text}}", "..."]

我使用了以下正则表达式,

"this is {{A}} sample {{text}} ...".split(RegExp("{{(.*?)}}"))

并得到,["this is ", " sample ", " ..."]

regex dart flutter

5
推荐指数
1
解决办法
776
查看次数

标签 统计

dart ×1

flutter ×1

regex ×1