C# 中 string 对象的 Replace 语法是:
string string.Replace(string oldValue, string newValue)
我们可能常常忘了应用其返回值,比如:要将 str 中的 "1" 替换成 "2",下面的做法是不正确的:
str.Replace("1", "2");
正确的做法是:
str = str.Replace("1", "2");
| ASP.NET 中的 AJAX | ASP.NET 画图全接触 | ASP.NET 与 XML | 声明式数据绑定 | ASP.NET 网页抓取 |
| C# 基础 | C# 类教程 | C# 加密 | ASP.NET 成员资格 | 非“自动化”处理 Excel |
| QuickAjax | Ajax | 完美的语法高亮器 | Silverlight | Popfly |
|
C# 中 string 对象的 Replace 语法是: string string.Replace(string oldValue, string newValue) 我们可能常常忘了应用其返回值,比如:要将 str 中的 "1" 替换成 "2",下面的做法是不正确的: str.Replace("1", "2"); 正确的做法是: str = str.Replace("1", "2"); 文章评论
|
栏目最新文章
|