【问题标题】:How to get string arraylist from string by filtering single single word from single string in flutter?如何通过从 flutter 中的单个字符串中过滤单个单词来从字符串中获取字符串数组列表?
【发布时间】:2023-02-07 20:26:37
【问题描述】:

“短语”:“受过教育的洗手间刺骨的微风重新组合耳机威胁流行朦胧低能油条骨”

所以,短语是我的字符串。 我想以字符串数组列表的形式获取短语字符串

stringList = ['受过教育','洗手间','刺痛',....]

【问题讨论】:

    标签: flutter


    【解决方案1】:

    你可以通过像这样使用字符串的拆分方法来做到这一点

    const string = 'Hello world!';
    final splitted = string.split(' ');
    print(splitted); // [Hello, world!];
    

    你可以从官方documentation阅读更多关于split方法的细节。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-16
      • 2022-06-27
      • 2016-02-05
      相关资源
      最近更新 更多