gavinsp

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace TestStringReplace
7 {
8 class Program
9 {
10 static void Main(string[] args)
11 {
12 String s = ";#ab;#bc;kk";
13 s = s.Replace(\';\', \'o\');
14 Console.WriteLine(s);
15 s = "abc";
16 s = s.Replace("ab","xy");
17 Console.WriteLine(s);
18 }
19 }
    //string 类型replace方法,在执行完之后返回的是一个副本,要使用这个副本必须赋值给一个新的变量。
20 }

分类:

技术点:

相关文章:

  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2022-03-09
猜你喜欢
  • 2021-10-11
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案