Utilities for strings

chr

returns a string encoding a codepoint

chr returns a string that encodes the single Unicode code point whose value is specified by the integer i

PARAMETERS

NameDescriptionDefault Value
iposition of the characternone

RETURNS

unicode string of the position

hex

Format integer to hexadecimal representation

PARAMETERS

NameDescriptionDefault Value
numbernumber to formatnone

RETURNS

hexadecimal representation of the number argument

ord

returns the codepoint of a character

ord(c) returns the integer value of the sole Unicode code point encoded by the string c.

If c does not encode exactly one Unicode code point, ord fails. Each invalid code within the string is treated as if it encodes the Unicode replacement character, U+FFFD.

PARAMETERS

NameDescriptionDefault Value
ccharacter whose codepoint to be returned.none

RETURNS

codepoint of c argument.

split_args

Split a string into a list space separated arguments

Unlike the naive .split(" "), this function takes quoted strings and escapes into account.

PARAMETERS

NameDescriptionDefault Value
sinput stringnone

RETURNS

list of strings with each an argument found in the input string