How to remove all whitespace of a string in Dart?

后端 未结 7 1945
半阙折子戏
半阙折子戏 2021-02-07 10:31

Using trim() to eliminate white space in Dart and it doesn\'t work. What am I doing wrong or is there an alternative?

       String product = \"COC         


        
相关标签:
7条回答
  • 2021-02-07 11:30

    This would solve your problem

    String name = "COCA COLA";
    print(name.replaceAll(' ', ''));
    
    0 讨论(0)
提交回复
热议问题