1.9 KiB
Utilities for strings
chr
chr(i)
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
Name | Description | Default Value |
---|---|---|
i | position of the character | none |
RETURNS
unicode string of the position
hex
hex(number)
Format integer to hexadecimal representation
PARAMETERS
Name | Description | Default Value |
---|---|---|
number | number to format | none |
RETURNS
hexadecimal representation of the number argument
ord
ord(c)
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
Name | Description | Default Value |
---|---|---|
c | character whose codepoint to be returned. | none |
RETURNS
codepoint of c
argument.
split_args
split_args(s)
Split a string into a list space separated arguments
Unlike the naive .split(" ")
, this function takes quoted strings
and escapes into account.
PARAMETERS
Name | Description | Default Value |
---|---|---|
s | input string | none |
RETURNS
list of strings with each an argument found in the input string