Splitting CamelCase with regex

前端 未结 4 708
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 20:18

I have this code to split CamelCase by regular expression:

Regex.Replace(input, \"(?<=[a-z])([A-Z])\", \" $1\", RegexOptions.Compiled).Trim();
         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-11 21:03

    You can try this :

    Regex.Replace(input, "((?

    Example :

    Regex.Replace("TheCapitalOfTheUAEIsAbuDhabi", "((?

    Output : The Capital Of The UAE Is Abu Dhabi

提交回复
热议问题