首页  编辑  

在字符串中排除相邻重复的字符

Tags: /C#/字符串处理/正则表达式/   Date Created:

using System . Text . RegularExpressions;

Text = Regex . Replace( "1112233445566" , @"(\w)\1+" , "$1" , RegexOptions . None);

//123456