How to remove all whitespace of a string in Dart?

后端 未结 7 1959
半阙折子戏
半阙折子戏 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(' ', ''));
    

提交回复
热议问题