Skip to main content

module  pixeltable.functions.string

Pixeltable UDFs for StringType. It closely follows the Pandas pandas.Series.str API. Example:

udf  capitalize()

Return string with its first character capitalized and the rest lowercased. Equivalent to str.capitalize().

udf  casefold()

Return a casefolded copy of string. Equivalent to str.casefold().

udf  center()

Return a centered string of length width. Equivalent to str.center(). Parameters:
  • width (Int): Total width of the resulting string.
  • fillchar (String): Character used for padding.

udf  contains()

Test if string contains a substring. Parameters:
  • substr (String): string literal or regular expression
  • case (Bool): if False, ignore case

udf  contains_re()

Test if string contains a regular expression pattern. Parameters:
  • pattern (String): regular expression pattern
  • flags (Int): flags for the re module

udf  count()

Count occurrences of pattern or regex. Parameters:
  • pattern (String): string literal or regular expression
  • flags (Int): flags for the re module

udf  endswith()

Return True if the string ends with the specified suffix, otherwise return False. Equivalent to str.endswith(). Parameters:
  • substr (String): string literal

udf  fill()

Wraps the single paragraph in string, and returns a single string containing the wrapped paragraph. Equivalent to textwrap.fill(). Parameters:
  • width (Int): Maximum line width.
  • kwargs (Any): Additional keyword arguments to pass to textwrap.fill().

udf  find()

Return the lowest index in string where substr is found within the slice s[start:end]. Equivalent to str.find(). Parameters:
  • substr (String): substring to search for
  • start (Int): slice start
  • end (Int | None): slice end

udf  findall()

Find all occurrences of a regular expression pattern in string. Equivalent to re.findall(). Parameters:
  • pattern (String): regular expression pattern
  • flags (Int): flags for the re module

udf  format()

Perform string formatting. Equivalent to str.format().

udf  fullmatch()

Determine if string fully matches a regular expression. Equivalent to re.fullmatch(). Parameters:
  • pattern (String): regular expression pattern
  • case (Bool): if False, ignore case
  • flags (Int): flags for the re module

udf  index()

Return the lowest index in string where 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 for
  • start (Int): slice start
  • end (Int | None): slice end

udf  isalnum()

Return 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()

Return True if all characters in the string are alphabetic and there is at least one character, False otherwise. Equivalent to str.isalpha().

udf  isascii()

Return True if the string is empty or all characters in the string are ASCII, False otherwise. Equivalent to str.isascii().

udf  isdecimal()

Return 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()

Return True if all characters in the string are digits and there is at least one character, False otherwise. Equivalent to str.isdigit().

udf  isidentifier()

Return True if the string is a valid identifier according to the language definition, False otherwise. Equivalent to str.isidentifier()

udf  islower()

Return 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()

Return True if all characters in the string are numeric characters, False otherwise. Equivalent to str.isnumeric()

udf  isspace()

Return 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()

Return True if the string is a titlecased string and there is at least one character, False otherwise. Equivalent to str.istitle()

udf  isupper()

Return 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()

Return a string which is the concatenation of the strings in elements. Equivalent to str.join()

udf  len()

Return the number of characters in the string. Equivalent to len(str)

udf  ljust()

Return the string left-justified in a string of length width. Equivalent to str.ljust() Parameters:
  • width (Int): Minimum width of resulting string; additional characters will be filled with character defined in fillchar.
  • fillchar (String): Additional character for filling.

udf  lower()

Return a copy of the string with all the cased characters converted to lowercase. Equivalent to str.lower()

udf  lstrip()

Return a copy of the string with leading characters removed. The 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()

Determine if string starts with a match of a regular expression Parameters:
  • pattern (String): regular expression pattern
  • case (Bool): if False, ignore case
  • flags (Int): flags for the re module

udf  normalize()

Return the Unicode normal form. Equivalent to unicodedata.normalize() Parameters:
  • form (String): Unicode normal form ('NFC', 'NFKC', 'NFD', 'NFKD')

udf  pad()

Pad string up to width Parameters:
  • width (Int): Minimum width of resulting string; additional characters will be filled with character defined in fillchar.
  • side (String): Side from which to fill resulting string ('left', 'right', 'both')
  • fillchar (String): Additional character for filling

udf  partition()

Splits string at the first occurrence of 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()

Remove prefix. If the prefix is not present, returns string.

udf  removesuffix()

Remove suffix. If the suffix is not present, returns string.

udf  repeat()

Repeat string n times.

udf  replace()

Replace occurrences of substr with repl. Equivalent to str.replace(). Parameters:
  • substr (String): string literal
  • repl (String): replacement string
  • n (Int | None): number of replacements to make (if None, replace all occurrences)

udf  replace_re()

Replace occurrences of a regular expression pattern with repl. Equivalent to re.sub(). Parameters:
  • pattern (String): regular expression pattern
  • repl (String): replacement string
  • n (Int | None): number of replacements to make (if None, replace all occurrences)
  • flags (Int): flags for the re module

udf  reverse()

Return a reversed copy of the string. Equivalent to str[::-1].

udf  rfind()

Return the highest index where substr is found, such that substr is contained within [start:end]. Equivalent to str.rfind(). Parameters:
  • substr (String): substring to search for
  • start (Int | None): slice start
  • end (Int | None): slice end

udf  rindex()

Return the highest index where substr is found, such that substr is contained within [start:end]. Raises ValueError if substr is not found. Equivalent to str.rindex().

udf  rjust()

Return the string right-justified in a string of length width. Equivalent to str.rjust(). Parameters:
  • width (Int): Minimum width of resulting string.
  • fillchar (String): Additional character for filling.

udf  rpartition()

This method splits string at the last occurrence of sep, and returns a list containing the part before the separator, the separator itself, and the part after the separator.

udf  rstrip()

Return a copy of string with trailing characters removed. Equivalent to str.rstrip(). Parameters:
  • chars (String | None): The set of characters to be removed. If omitted or None, whitespace characters are removed.

udf  slice()

Return a slice. Parameters:
  • start (Int | None): slice start
  • stop (Int | None): slice end
  • step (Int | None): slice step

udf  slice_replace()

Replace a positional slice with another value. Parameters:
  • start (Int | None): slice start
  • stop (Int | None): slice end
  • repl (String | None): replacement value

udf  startswith()

Return True if string starts with substr, otherwise return False. Equivalent to str.startswith(). Parameters:
  • substr (String): string literal

udf  strip()

Return a copy of string with leading and trailing characters removed. Equivalent to str.strip(). Parameters:
  • chars (String | None): The set of characters to be removed. If omitted or None, whitespace characters are removed.

udf  swapcase()

Return a copy of string with uppercase characters converted to lowercase and vice versa. Equivalent to str.swapcase().

udf  title()

Return a titlecased version of string, i.e. words start with uppercase characters, all remaining cased characters are lowercase. Equivalent to str.title().

udf  upper()

Return a copy of string converted to uppercase. Equivalent to str.upper().

udf  wrap()

Wraps the single paragraph in string so every line is at most 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 to textwrap.fill().
Last modified on June 12, 2026