using System;
using System.Collections;
using System.Text.RegularExpressions;
public class MyClass
{
 public static void Main()
 {
  string str_1="sHjhgsdKkjhLjk";
 Console.WriteLine(str_1+"\n");
 Console.WriteLine(Regex.Replace(str_1,"[A-Z]",new MatchEvaluator(Replace)));
//new MatchEvaluator(Replace)用委托,对匹配的字符处理
  RL();
 }
 public static string Replace(Match m)//
      {
  return " "+m.Value;
      }

 #region Helper methods

 private static void WL(object text, params object[] args)
 {
  Console.WriteLine(text.ToString(), args); 
 }
 
 private static void RL()
 {
  Console.ReadLine(); 
 }
 
 private static void Break()
 {
  System.Diagnostics.Debugger.Break();
 }

 #endregion
}

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-11-17
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2022-02-11
  • 2021-11-17
  • 2021-11-17
  • 2022-12-23
  • 2021-11-17
  • 2021-12-31
相关资源
相似解决方案