-
Notifications
You must be signed in to change notification settings - Fork 26
String Case functions
Johnny M. Salas edited this page Jun 9, 2022
·
5 revisions
| Case | Example | Method | Trigger |
|---|---|---|---|
| Upper case | LOREM IPSUM | textcase.api.to_constant_case | u |
| Lower case | lorem ipsum | textcase.api.to_lower_case | l |
| Snake case | lorem_ipsum | textcase.api.to_snake_case | s |
| Dash case | lorem-ipsum | textcase.api.to_dash_case | d |
| Constant case | LOREM_IPSUM | textcase.api.to_constant_case | n |
| Dot case | lorem.ipsum | textcase.api.to_dot_case | |
| Camel case | loremIpsum | textcase.api.to_camel_case | c |
| Pascal case | LoremIpsum | textcase.api.to_pascal_case | p |
| Title case | Lorem Ipsum | textcase.api.to_title_case | |
| Path case | lorem/ipsum | textcase.api.to_path_case | |
| Phrase case | Lorem ipsum | textcase.api.to_phrase_case |
To use the keybindings
Do not forget to call the setup method as mentioned in the readme
require('textcase').setup {}
To use the functions in your LUA code
require the library and call apply method as shown bellow:
local textcase = require('textcase')
local result = textcase.api.to_dash_case('Dash case')
-- result --> dash-case