永发信息网

c#中repList怎样实现修改功能

答案:1  悬赏:20  手机版
解决时间 2021-03-09 09:47
  • 提问者网友:棒棒糖
  • 2021-03-08 15:16
c#中repList怎样实现修改功能
最佳答案
  • 五星知识达人网友:洒脱疯子
  • 2021-03-08 15:46
public string Replace ( string oldValue, string newValue) 这是 Replace 的C#语法.参数oldValue要替换的 String。
newValue要替换 oldValue 的所有匹配项的 String。

返回值等效于此实例,但将 oldValue 的所有实例都替换为 newValue 的 String。
示例

下面的代码示例说明如何使用 Replace 方法来更正拼写错误。using System;public class ReplaceTest { public static void Main() { string errString = "This docment uses 3 other docments to docment the docmentation"; Console.WriteLine("The original string is:{0}'{1}'{0}", Environment.NewLine, errString); // Correct the spelling of "document". string correctString = errString.Replace("docment", "document"); Console.WriteLine("After correcting the string, the result is:{0}'{1}'", Environment.NewLine, correctString); }}//// This code example produces the following output://// The original string is:// 'This docment uses 3 other docments to docment the docmentation'//// After correcting the string, the result is:// 'This document uses 3 other documents to document the documentation'//

同学..SDK上都有的.学会看文档..
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯