String#

The following methods are available under the expr.str attribute.

Expr.str.concat([delimiter])

Vertically concat the values in the Series to a single string value.

Expr.str.contains(pattern[, literal, strict])

Check if string contains a substring that matches a regex.

Expr.str.count_match(pattern)

Count all successive non-overlapping regex matches.

Expr.str.decode(encoding, *[, strict])

Decode a value using the provided encoding.

Expr.str.encode(encoding)

Encode a value using the provided encoding.

Expr.str.ends_with(sub)

Check if string values end with a substring.

Expr.str.explode()

Returns a column with a separate row for every string character.

Expr.str.extract(pattern[, group_index])

Extract the target capture group from provided patterns.

Expr.str.extract_all(pattern)

Extracts all matches for the given regex pattern.

Expr.str.json_extract([dtype])

Parse string values as JSON.

Expr.str.json_path_match(json_path)

Extract the first match of json string with provided JSONPath expression.

Expr.str.lengths()

Get length of the strings as UInt32 (as number of bytes).

Expr.str.ljust(width[, fillchar])

Return the string left justified in a string of length width.

Expr.str.lstrip([matches])

Remove leading characters.

Expr.str.n_chars()

Get length of the strings as UInt32 (as number of chars).

Expr.str.replace(pattern, value[, literal, n])

Replace first matching regex/literal substring with a new string value.

Expr.str.replace_all(pattern, value[, literal])

Replace all matching regex/literal substrings with a new string value.

Expr.str.rjust(width[, fillchar])

Return the string right justified in a string of length width.

Expr.str.rstrip([matches])

Remove trailing characters.

Expr.str.slice(offset[, length])

Create subslices of the string values of a Utf8 Series.

Expr.str.split(by[, inclusive])

Split the string by a substring.

Expr.str.split_exact(by, n[, inclusive])

Split the string by a substring using n splits.

Expr.str.splitn(by, n)

Split the string by a substring, restricted to returning at most n items.

Expr.str.starts_with(sub)

Check if string values start with a substring.

Expr.str.strip([matches])

Remove leading and trailing characters.

Expr.str.strptime(datatype[, fmt, strict, ...])

Parse a Utf8 expression to a Date/Datetime/Time type.

Expr.str.to_lowercase()

Transform to lowercase variant.

Expr.str.to_uppercase()

Transform to uppercase variant.

Expr.str.zfill(alignment)

Fills the string with zeroes.

Expr.str.parse_int([radix, strict])

Parse integers with base radix from strings.