In Intellij, how do I toggle between camel case and underscore spaced?

后端 未结 5 778
时光取名叫无心
时光取名叫无心 2021-01-29 20:08

At my company we have two different style guides for java vs sql. In java I have a field named historyOfPresentIllness and when i write the sql, I want to name it

5条回答
  •  不知归路
    2021-01-29 20:49

    Very simple press Clr + F to open Find/Replace panel and check [✓] Regex copy past regex

    Find: [_]{1,1}([a-z])

    Replace: \U$1

    Press [Replace all] button, Enjoy


    Thanks @piotrek for _some_awe_var to _someAweVar

    Use Find: (\w)[_]{1,1}([a-z])
    Replace: $1\U$2

提交回复
热议问题