Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a selection to lowercase or uppercase in Sublime Text

Tags:

sublimetext

I have several strings selected in a file in Sublime Text and I want to convert them all to lowercase.

How can I convert them all to lowercase in Sublime Text?

like image 385
arturomp Avatar asked Sep 12 '13 20:09

arturomp


People also ask

How do I change text from selected to uppercase?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.

How can we convert a string to uppercase and lowercase?

An array of char type s[100] is declared which will store the entered string by user. Then, for loop is used to convert the string into upper case string and if block is used to check that if characters are in lower case then, convert them in upper case by subtracting 32 from their ASCII value.

How do you change lowercase to uppercase without retyping?

In Word and Outlook for Windows hold SHIFT + F3 (tap to cycle) until the case you want is applied (if you have a laptop you may also need to hold the FN key). In Word for Mac press fn+ SHIFT + F3 until the style you want is applied.


2 Answers

From the Sublime Text docs for Windows/Linux:

Keypress            Command Ctrl + K, Ctrl + U  Transform to Uppercase Ctrl + K, Ctrl + L  Transform to Lowercase 

and for Mac:

Keypress    Command cmd + KU    Transform to Uppercase cmd + KL    Transform to Lowercase 

Also note that Ctrl + Shift + p in Windows ( + Shift + p in a Mac) brings up the Command Palette where you can search for these and other commands. It looks like this:

enter image description here

like image 161
arturomp Avatar answered Oct 08 '22 04:10

arturomp


For Windows:

  • Ctrl+K,Ctrl+U for UPPERCASE.
  • Ctrl+K,Ctrl+L for lowercase.

Method 1 (Two keys pressed at a time)

  1. Press Ctrl and hold.
  2. Now press K, release K while holding Ctrl. (Do not release the Ctrl key)
  3. Immediately, press U (for uppercase) OR L (for lowercase) with Ctrl still being pressed, then release all pressed keys.

Method 2 (3 keys pressed at a time)

  1. Press Ctrl and hold.
  2. Now press K.
  3. Without releasing Ctrl and K, immediately press U (for uppercase) OR L (for lowercase) and release all pressed keys.

Please note: If you press and hold Ctrl+K for more than two seconds it will start deleting text so try to be quick with it.

I use the above shortcuts, and they work on my Windows system.

like image 35
Anish Nair Avatar answered Oct 08 '22 06:10

Anish Nair