Question

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?
Was it helpful?

Solution

I believe this is what you're looking for

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

OTHER TIPS

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

result = result.replace(/ /g, "_");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top