Added escape and unescape

This commit is contained in:
Luke Rogers 2013-10-01 03:42:55 +13:00
parent f8ad033f8e
commit d673f8d15c
1 changed files with 10 additions and 1 deletions

View File

@ -30,7 +30,6 @@ def swapcase(inp):
"""swapcase <string> -- Swaps the capitalization of <string>."""
return inp.swapcase()
# encoding
@hook.command
@ -38,6 +37,16 @@ def rot13(inp):
"""rot13 <string> -- Encode <string> with rot13."""
return inp.encode('rot13')
@hook.command
def unescape(inp):
"""unescape <string> -- Unescapes <string>."""
return inp.decode('unicode-escape')
@hook.command
def escape(inp):
"""escape <string> -- escapes <string>."""
return inp.encode('unicode-escape')
# length
@hook.command