小编Ign*_*imo的帖子

用下划线替换字符串空格

我需要用下划线替换一些空格(即"PM HD PSP">"PM_HD_PSP")

这是我到目前为止所尝试的:

private string NombreExcel3(string excel)
{
    MessageBox.Show(excel);

    excel.Replace(' ','_');

    MessageBox.Show(excel);
    return excel;
}
Run Code Online (Sandbox Code Playgroud)

c# string replace

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

replace ×1

string ×1