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?
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?
There are two options available.
Use toggle case action
Select text
Invoke Edit | Toggle Case action or
Keyboard shortcut: Ctrl + Shift + U for Windows/Linux & Cmd + Shift + U for Mac
Use find and replace text using regular expressions
Select text
Invoke Edit | Find | Replace⦠action or
Keyboard shortcut: Ctrl + R for Windows/Linux & Cmd + R for Mac
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