StringType. It closely follows the Pandas pandas.Series.str API.
Example:
udf capitalize()
str.capitalize().
udf casefold()
str.casefold().
udf center()
width.
Equivalent to str.center().
Parameters:
width(Int): Total width of the resulting string.fillchar(String): Character used for padding.
udf contains()
substr(String): string literal or regular expressioncase(Bool): if False, ignore case
udf contains_re()
pattern(String): regular expression patternflags(Int): flags for theremodule
udf count()
pattern(String): string literal or regular expressionflags(Int): flags for theremodule
udf endswith()
True if the string ends with the specified suffix, otherwise return False.
Equivalent to str.endswith().
Parameters:
substr(String): string literal
udf fill()
textwrap.fill().
Parameters:
width(Int): Maximum line width.kwargs(Any): Additional keyword arguments to pass totextwrap.fill().
udf find()
substr is found within the slice s[start:end].
Equivalent to str.find().
Parameters:
substr(String): substring to search forstart(Int): slice startend(Int | None): slice end
udf findall()
re.findall().
Parameters:
pattern(String): regular expression patternflags(Int): flags for theremodule
udf format()
str.format().
udf fullmatch()
re.fullmatch().
Parameters:
pattern(String): regular expression patterncase(Bool): if False, ignore caseflags(Int): flags for theremodule
udf index()
substr is found within the slice [start:end].
Raises ValueError if substr is not found.
Equivalent to str.index().
Parameters:
substr(String): substring to search forstart(Int): slice startend(Int | None): slice end
udf isalnum()
True if all characters in the string are alphanumeric and there is at least one character, False
otherwise.
Equivalent to [str.isalnum()](https://docs.python.org/3/library/stdtypes.html#str.isalnum
udf isalpha()
True if all characters in the string are alphabetic and there is at least one character, False otherwise.
Equivalent to str.isalpha().
udf isascii()
True if the string is empty or all characters in the string are ASCII, False otherwise.
Equivalent to str.isascii().
udf isdecimal()
True if all characters in the string are decimal characters and there is at least one character, False
otherwise.
Equivalent to str.isdecimal().
udf isdigit()
True if all characters in the string are digits and there is at least one character, False otherwise.
Equivalent to str.isdigit().
udf isidentifier()
True if the string is a valid identifier according to the language definition, False otherwise.
Equivalent to str.isidentifier()
udf islower()
True if all cased characters in the string are lowercase and there is at least one cased character,
False otherwise.
Equivalent to str.islower()
udf isnumeric()
True if all characters in the string are numeric characters, False otherwise.
Equivalent to str.isnumeric()
udf isspace()
True if there are only whitespace characters in the string and there is at least one character,
False otherwise.
Equivalent to str.isspace()
udf istitle()
True if the string is a titlecased string and there is at least one character, False otherwise.
Equivalent to str.istitle()
udf isupper()
True if all cased characters in the string are uppercase and there is at least one cased character,
False otherwise.
Equivalent to str.isupper()
udf join()
elements.
Equivalent to str.join()
udf len()
len(str)
udf ljust()
width.
Equivalent to str.ljust()
Parameters:
width(Int): Minimum width of resulting string; additional characters will be filled with character defined infillchar.fillchar(String): Additional character for filling.
udf lower()
str.lower()
udf lstrip()
chars argument is a string specifying the set of
characters to be removed. If omitted or None, whitespace characters are removed.
Equivalent to str.lstrip()
Parameters:
chars(String | None): The set of characters to be removed.
udf match()
pattern(String): regular expression patterncase(Bool): if False, ignore caseflags(Int): flags for theremodule
udf normalize()
unicodedata.normalize()
Parameters:
form(String): Unicode normal form ('NFC','NFKC','NFD','NFKD')
udf pad()
width(Int): Minimum width of resulting string; additional characters will be filled with character defined infillchar.side(String): Side from which to fill resulting string ('left','right','both')fillchar(String): Additional character for filling
udf partition()
sep, and returns 3 elements containing the part before the
separator, the separator itself, and the part after the separator. If the separator is not found, return 3 elements containing string itself, followed by two empty strings.
udf removeprefix()
udf removesuffix()
udf repeat()
n times.
udf replace()
substr with repl.
Equivalent to str.replace().
Parameters:
substr(String): string literalrepl(String): replacement stringn(Int | None): number of replacements to make (ifNone, replace all occurrences)
udf replace_re()
repl.
Equivalent to re.sub().
Parameters:
pattern(String): regular expression patternrepl(String): replacement stringn(Int | None): number of replacements to make (ifNone, replace all occurrences)flags(Int): flags for theremodule
udf reverse()
str[::-1].
udf rfind()
substr is found, such that substr is contained within [start:end].
Equivalent to str.rfind().
Parameters:
substr(String): substring to search forstart(Int | None): slice startend(Int | None): slice end
udf rindex()
substr is found, such that substr is contained within [start:end].
Raises ValueError if substr is not found.
Equivalent to str.rindex().
udf rjust()
width.
Equivalent to str.rjust().
Parameters:
width(Int): Minimum width of resulting string.fillchar(String): Additional character for filling.
udf rpartition()
sep, and returns a list containing the part before the
separator, the separator itself, and the part after the separator.
udf rstrip()
str.rstrip().
Parameters:
chars(String | None): The set of characters to be removed. If omitted orNone, whitespace characters are removed.
udf slice()
start(Int | None): slice startstop(Int | None): slice endstep(Int | None): slice step
udf slice_replace()
start(Int | None): slice startstop(Int | None): slice endrepl(String | None): replacement value
udf startswith()
True if string starts with substr, otherwise return False.
Equivalent to str.startswith().
Parameters:
substr(String): string literal
udf strip()
str.strip().
Parameters:
chars(String | None): The set of characters to be removed. If omitted orNone, whitespace characters are removed.
udf swapcase()
str.swapcase().
udf title()
str.title().
udf upper()
str.upper().
udf wrap()
width characters long.
Returns a list of output lines, without final newlines.
Equivalent to textwrap.fill().
Parameters:
width(Int): Maximum line width.kwargs(Any): Additional keyword arguments to pass totextwrap.fill().