假设初始字符串是
String result= "Welcome To All" for that i need updated result as
String result="Welcome_To_All" string value is dynamic,how can i do that,thank for help?
答案 0 :(得分:0)
我相信这就是你正在寻找的东西
string oldstr = "Hello World";
string s = oldstr.Replace(" ", "_");
(s == "Hello_World");
答案 1 :(得分:0)
我猜你正在使用javascript,你可以使用正则表达式。
result = result.replace(/ /g, "_");