Added escape and unescape
This commit is contained in:
parent
f8ad033f8e
commit
d673f8d15c
|
@ -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
|
||||
|
|
Reference in New Issue