Python: convert camel case to space delimited using RegEx and taking Acronyms into account

后端 未结 10 1911
逝去的感伤
逝去的感伤 2020-12-29 04:38

I am trying to convert camel case to space separated values using python. For example:

divLineColor -> div Line Color

This lin

10条回答
  •  一向
    一向 (楼主)
    2020-12-29 05:05

    Other method:

    def solution(s):
        return ''.join(' ' + c if c.isupper() else c for c in s)
    print(solution("mehdHidi"))
    

提交回复
热议问题