문제

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