我需要用小写字母替换变量名中的大写字母并添加空格
例如:
NotImplementedException应该Not implemented exception
UnhandledException应该Unhandled exception
Jen*_*ens 39
由于您没有指定语言,我将在C#中给出一个示例.我相信你的语言会提供类似的东西.
String s = "NotImplementedException";
s = Regex.Replace(s, @"\B[A-Z]", m => " " + m.ToString().ToLower());
// s = "Not implemented exception"
Run Code Online (Sandbox Code Playgroud)