-
Notifications
You must be signed in to change notification settings - Fork 1
Text Humanize
Vali (naser) Rafinia edited this page Mar 27, 2023
·
2 revisions
The nhash text humanize
command provides various options to convert a given text into different humanized forms such as Pascal-case, Camel-case, Kebab-case, Underscore, lowercase, etc.
nhash text humanize <type> <text> [options]
The command takes two mandatory arguments: <type>
and <text>
. The <type>
argument specifies the type of humanization that you want to apply to the given <text>
. The following are the available humanization options:
-
camel
: Convert the text into camelCase. -
dehumanize
: Convert the text from humanized format to a normal string. -
humanize
: Convert the text into a humanized form. -
hyphenate
: Convert the text into a kebab case. -
kebab
: Convert the text into kebab-case. -
lowercase
: Convert the text into lowercase. -
pascal
: Convert the text into PascalCase. -
underscore
: Convert the text into snake_case. -
uppercase
: Convert the text into UPPERCASE.
-
-o, --output <output>
: File name for writing the output. -
-?, -h, --help
: Show help and usage information.
-
<text>
: The<text>
argument specifies the text to be humanized.
- Convert text to CamelCase:
nhash text humanize camel "this is a text"
Output:
thisIsAText
- Convert text to kebab-case:
nhash text humanize kebab "This is a Text"
Output:
this-is-a-text
- Convert text to snake_case:
nhash text humanize underscore "This is a Text"
Output:
this_is_a_text
- Convert text to PascalCase:
nhash text humanize pascal "This is a Text"
Output:
ThisIsAText
- Convert text to lowercase:
nhash text humanize lowercase "This is a Text"
Output:
this is a text
- Convert text to UPPERCASE:
nhash text humanize uppercase "This is a Text"
Output:
THIS IS A TEXT
- Convert a humanized text to a normal string:
nhash text humanize dehumanize "ThisIsAText"
Output:
this is a text
- Write output to a file:
nhash text humanize camel "this is a text" --output output.txt
The above command will write the output to a file named output.txt
.