Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text uppercase option in intellij?

Just imagine I have defined a list of static variables in lower case on my editor.

Is there any option in intellij where I can select a portion of my source code and convert it into either upper/lower case?

like image 222
Supun Wijerathne Avatar asked Dec 01 '25 20:12

Supun Wijerathne


1 Answers

There are two options available.

  1. Use toggle case action

    • Select text

    • Invoke Edit | Toggle Case action or

      Keyboard shortcut:
      Windows & Linux: Ctrl + Shift + U
      Mac: + Shift + U

  2. Use find and replace text using regular expressions

    • Select text

    • Invoke Edit | Find | Replace… action or

      Keyboard shortcut:
      Windows & Linux: Ctrl + R
      Mac: + R

    • Choose the "Search In Selection" & "Regex" search options

    • Search for (.+) to select all characters and include them in a single capturing group

    • Use \U$1 as the replacement, which replaces all characters in the capturing group with the uppercase equivalent

    • Click "Replace All" to perform the text replacement

like image 142
Andrey Avatar answered Dec 05 '25 01:12

Andrey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!