本节内容:
asp.net字符串转换
方法一:
方法二:
方法三:
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
string a = "123456789"; // www.jb200.com
Regex reg = new Regex(@"^(d{2})(d{3})(d{4})$");
a = reg.Replace(a, "$1-$2-$3");
Console.Write(a);
}
}
}