The study notes C # - a string to a string of (replacement, etc.)

Replace spaces

class Solution
{
    public string replaceSpace(string str)
    {
        // write code here
        string newStr = str.Replace(" ", "%20");
        return newStr;
    }
}

 

Guess you like

Origin blog.csdn.net/Alina_catty/article/details/91288267