Added more text tools

This commit is contained in:
Luke Rogers 2013-10-01 03:32:06 +13:00
parent 52b14b367a
commit f8ad033f8e

View file

@ -3,6 +3,13 @@ import hashlib
# 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
def upper(inp):
"""upper <string> -- Convert string to uppercase."""
@ -18,6 +25,11 @@ def titlecase(inp):
"""title <string> -- Convert string to title case."""
return inp.title()
@hook.command
def swapcase(inp):
"""swapcase <string> -- Swaps the capitalization of <string>."""
return inp.swapcase()
# encoding