質問

Suppose initial string is

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?
役に立ちましたか?

解決

I believe this is what you're looking for

    string oldstr = "Hello World";
    string s = oldstr.Replace(" ", "_");
    (s == "Hello_World");

他のヒント

I'm going to guess that you're using javascript and you're ok with using regular expressions.

result = result.replace(/ /g, "_");
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top