Added more text tools
This commit is contained in:
parent
52b14b367a
commit
f8ad033f8e
1 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,13 @@ import hashlib
|
||||||
|
|
||||||
# basic text tools
|
# basic text tools
|
||||||
|
|
||||||
|
## TODO: make this capitalize sentences correctly
|
||||||
|
@hook.command("capitalise")
|
||||||
|
@hook.command
|
||||||
|
def capitalize(inp):
|
||||||
|
"""capitalize <string> -- Capitalizes <string>."""
|
||||||
|
return inp.capitalize()
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
def upper(inp):
|
def upper(inp):
|
||||||
"""upper <string> -- Convert string to uppercase."""
|
"""upper <string> -- Convert string to uppercase."""
|
||||||
|
@ -18,6 +25,11 @@ def titlecase(inp):
|
||||||
"""title <string> -- Convert string to title case."""
|
"""title <string> -- Convert string to title case."""
|
||||||
return inp.title()
|
return inp.title()
|
||||||
|
|
||||||
|
@hook.command
|
||||||
|
def swapcase(inp):
|
||||||
|
"""swapcase <string> -- Swaps the capitalization of <string>."""
|
||||||
|
return inp.swapcase()
|
||||||
|
|
||||||
|
|
||||||
# encoding
|
# encoding
|
||||||
|
|
||||||
|
|
Reference in a new issue