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

后端 未结 5 685
时光取名叫无心
时光取名叫无心 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:56

    Answer above is almost perfect, but note that it will change variables like _something or this._something into Something and this.Something. I didn't want that in my case, as leading _ was used to denote "private" variables (old JS project). I slightly modified this approach:

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

    Replace: $1\U$2

    This will ensure that only variables with _ is in the middle will be affected.

提交回复
热议问题