Вопрос

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