首页 > 代码库 > c# 用正则表达式在指定的字符串中每隔指定个数的文字插入指定字符串

c# 用正则表达式在指定的字符串中每隔指定个数的文字插入指定字符串

        public static string AddNewLine(string inString,int num,string addString="\r\n")        {            return Regex.Replace(inString, string.Format(@".{{{0}}}", num), "$0"+addString);        }