📄 class1.cs
字号:
using System;
using System.Text.RegularExpressions;
namespace RXProperCase
{
public class RXProperCaseApp
{
[STAThread]
static void Main(string[] args)
{
string s = "the qUEEn wAs in HER parLOr";
Console.WriteLine("Initial String:\t{0}", s);
s = s.ToLower();
string sProper = "";
string e = @"\w+|\W+";
foreach (Match m in Regex.Matches(s, e))
{
sProper += char.ToUpper(m.Value[0])
+ m.Value.Substring(1, m.Length - 1);
}
Console.WriteLine("ProperCase:\t{0}", sProper);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -