Replace certain string in array of strings

后端 未结 7 908
广开言路
广开言路 2021-01-12 22:07

let\'s say I have this string array in java

String[] test = {"hahaha lol", "jeng jeng jeng", &quo         


        
相关标签:
7条回答
  • 2021-01-12 22:42

    Try using String#relaceAll(regex,replacement); untested, but this should work:

    for (int i=0; i<test.length; i++) {
      test[i] = test[i].replaceAll(" ", "%20");
    }
    
    0 讨论(0)
提交回复
热议问题