C#学习笔记之——对字符串string的操作(替换等)

替换空格

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

猜你喜欢

转载自blog.csdn.net/Alina_catty/article/details/91288267
今日推荐