سؤال

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