pub trait StringNameSpaceImpl: AsString {
Show 44 methods
// Provided methods
fn hex_decode(&self) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn hex_encode(&self) -> ChunkedArray<StringType> { ... }
fn base64_decode(&self) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn base64_encode(&self) -> ChunkedArray<StringType> { ... }
fn to_integer(
&self,
base: &ChunkedArray<UInt32Type>,
strict: bool,
) -> Result<ChunkedArray<Int64Type>, PolarsError> { ... }
fn contains_chunked(
&self,
pat: &ChunkedArray<StringType>,
literal: bool,
strict: bool,
) -> Result<ChunkedArray<BooleanType>, PolarsError> { ... }
fn find_chunked(
&self,
pat: &ChunkedArray<StringType>,
literal: bool,
strict: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn starts_with(&self, sub: &str) -> ChunkedArray<BooleanType> { ... }
fn starts_with_chunked(
&self,
prefix: &ChunkedArray<StringType>,
) -> ChunkedArray<BooleanType> { ... }
fn str_len_chars(&self) -> ChunkedArray<UInt32Type> { ... }
fn str_len_bytes(&self) -> ChunkedArray<UInt32Type> { ... }
fn contains(
&self,
pat: &str,
strict: bool,
) -> Result<ChunkedArray<BooleanType>, PolarsError> { ... }
fn contains_literal(
&self,
lit: &str,
) -> Result<ChunkedArray<BooleanType>, PolarsError> { ... }
fn find_literal(
&self,
lit: &str,
) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn find(
&self,
pat: &str,
strict: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn replace<'a>(
&'a self,
pat: &str,
val: &str,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn replace_literal<'a>(
&'a self,
pat: &str,
val: &str,
n: usize,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn replace_all(
&self,
pat: &str,
val: &str,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn replace_literal_all<'a>(
&'a self,
pat: &str,
val: &str,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn extract(
&self,
pat: &ChunkedArray<StringType>,
group_index: usize,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn extract_all(
&self,
pat: &str,
) -> Result<ChunkedArray<ListType>, PolarsError> { ... }
fn strip_chars(
&self,
pat: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn strip_chars_start(
&self,
pat: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn strip_chars_end(
&self,
pat: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn strip_prefix(
&self,
prefix: &ChunkedArray<StringType>,
) -> ChunkedArray<StringType> { ... }
fn strip_suffix(
&self,
suffix: &ChunkedArray<StringType>,
) -> ChunkedArray<StringType> { ... }
fn split_exact(
&self,
by: &ChunkedArray<StringType>,
n: usize,
) -> Result<ChunkedArray<StructType>, PolarsError> { ... }
fn split_exact_inclusive(
&self,
by: &ChunkedArray<StringType>,
n: usize,
) -> Result<ChunkedArray<StructType>, PolarsError> { ... }
fn splitn(
&self,
by: &ChunkedArray<StringType>,
n: usize,
) -> Result<ChunkedArray<StructType>, PolarsError> { ... }
fn split(&self, by: &ChunkedArray<StringType>) -> ChunkedArray<ListType> { ... }
fn split_inclusive(
&self,
by: &ChunkedArray<StringType>,
) -> ChunkedArray<ListType> { ... }
fn extract_all_many(
&self,
pat: &ChunkedArray<StringType>,
) -> Result<ChunkedArray<ListType>, PolarsError> { ... }
fn extract_groups(
&self,
pat: &str,
dtype: &DataType,
) -> Result<Series, PolarsError> { ... }
fn count_matches(
&self,
pat: &str,
literal: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn count_matches_many(
&self,
pat: &ChunkedArray<StringType>,
literal: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... }
fn to_lowercase(&self) -> ChunkedArray<StringType> { ... }
fn to_uppercase(&self) -> ChunkedArray<StringType> { ... }
fn to_titlecase(&self) -> ChunkedArray<StringType> { ... }
fn concat(
&self,
other: &ChunkedArray<StringType>,
) -> ChunkedArray<StringType> { ... }
fn str_reverse(&self) -> ChunkedArray<StringType> { ... }
fn str_slice(
&self,
offset: &Column,
length: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn str_head(
&self,
n: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn str_tail(
&self,
n: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError> { ... }
fn str_escape_regex(&self) -> ChunkedArray<StringType> { ... }
}
polars-ops
only.Provided Methods§
fn hex_decode(&self) -> Result<ChunkedArray<StringType>, PolarsError>
binary_encoding
only.fn hex_encode(&self) -> ChunkedArray<StringType>
string_encoding
only.fn base64_decode(&self) -> Result<ChunkedArray<StringType>, PolarsError>
binary_encoding
only.fn base64_encode(&self) -> ChunkedArray<StringType>
string_encoding
only.fn to_integer( &self, base: &ChunkedArray<UInt32Type>, strict: bool, ) -> Result<ChunkedArray<Int64Type>, PolarsError>
string_to_integer
only.fn contains_chunked( &self, pat: &ChunkedArray<StringType>, literal: bool, strict: bool, ) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn find_chunked( &self, pat: &ChunkedArray<StringType>, literal: bool, strict: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Sourcefn starts_with(&self, sub: &str) -> ChunkedArray<BooleanType>
fn starts_with(&self, sub: &str) -> ChunkedArray<BooleanType>
Check if strings starts with a substring
Sourcefn starts_with_chunked(
&self,
prefix: &ChunkedArray<StringType>,
) -> ChunkedArray<BooleanType>
fn starts_with_chunked( &self, prefix: &ChunkedArray<StringType>, ) -> ChunkedArray<BooleanType>
This is more performant than the BinaryChunked version because we use the inline prefix Use the BinaryChunked::ends_with as there is no specialization here for that
Sourcefn str_len_chars(&self) -> ChunkedArray<UInt32Type>
fn str_len_chars(&self) -> ChunkedArray<UInt32Type>
Get the length of the string values as number of chars.
Sourcefn str_len_bytes(&self) -> ChunkedArray<UInt32Type>
fn str_len_bytes(&self) -> ChunkedArray<UInt32Type>
Get the length of the string values as number of bytes.
Sourcefn contains(
&self,
pat: &str,
strict: bool,
) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn contains( &self, pat: &str, strict: bool, ) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if strings contain a regex pattern.
Sourcefn contains_literal(
&self,
lit: &str,
) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn contains_literal( &self, lit: &str, ) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if strings contain a given literal
Sourcefn find_literal(
&self,
lit: &str,
) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn find_literal( &self, lit: &str, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Return the index position of a literal substring in the target string.
Sourcefn find(
&self,
pat: &str,
strict: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn find( &self, pat: &str, strict: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Return the index position of a regular expression substring in the target string.
Sourcefn replace<'a>(
&'a self,
pat: &str,
val: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
fn replace<'a>( &'a self, pat: &str, val: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Replace the leftmost regex-matched (sub)string with another string
Sourcefn replace_literal<'a>(
&'a self,
pat: &str,
val: &str,
n: usize,
) -> Result<ChunkedArray<StringType>, PolarsError>
fn replace_literal<'a>( &'a self, pat: &str, val: &str, n: usize, ) -> Result<ChunkedArray<StringType>, PolarsError>
Replace the leftmost literal (sub)string with another string
Sourcefn replace_all(
&self,
pat: &str,
val: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
fn replace_all( &self, pat: &str, val: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Replace all regex-matched (sub)strings with another string
Sourcefn replace_literal_all<'a>(
&'a self,
pat: &str,
val: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
fn replace_literal_all<'a>( &'a self, pat: &str, val: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Replace all matching literal (sub)strings with another string
Sourcefn extract(
&self,
pat: &ChunkedArray<StringType>,
group_index: usize,
) -> Result<ChunkedArray<StringType>, PolarsError>
fn extract( &self, pat: &ChunkedArray<StringType>, group_index: usize, ) -> Result<ChunkedArray<StringType>, PolarsError>
Extract the nth capture group from pattern.
Sourcefn extract_all(&self, pat: &str) -> Result<ChunkedArray<ListType>, PolarsError>
fn extract_all(&self, pat: &str) -> Result<ChunkedArray<ListType>, PolarsError>
Extract each successive non-overlapping regex match in an individual string as an array.
fn strip_chars( &self, pat: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>
fn strip_chars_start( &self, pat: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>
fn strip_chars_end( &self, pat: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>
fn strip_prefix( &self, prefix: &ChunkedArray<StringType>, ) -> ChunkedArray<StringType>
fn strip_suffix( &self, suffix: &ChunkedArray<StringType>, ) -> ChunkedArray<StringType>
fn split_exact( &self, by: &ChunkedArray<StringType>, n: usize, ) -> Result<ChunkedArray<StructType>, PolarsError>
dtype-struct
only.fn split_exact_inclusive( &self, by: &ChunkedArray<StringType>, n: usize, ) -> Result<ChunkedArray<StructType>, PolarsError>
dtype-struct
only.fn splitn( &self, by: &ChunkedArray<StringType>, n: usize, ) -> Result<ChunkedArray<StructType>, PolarsError>
dtype-struct
only.fn split(&self, by: &ChunkedArray<StringType>) -> ChunkedArray<ListType>
fn split_inclusive( &self, by: &ChunkedArray<StringType>, ) -> ChunkedArray<ListType>
Sourcefn extract_all_many(
&self,
pat: &ChunkedArray<StringType>,
) -> Result<ChunkedArray<ListType>, PolarsError>
fn extract_all_many( &self, pat: &ChunkedArray<StringType>, ) -> Result<ChunkedArray<ListType>, PolarsError>
Extract each successive non-overlapping regex match in an individual string as an array.
Sourcefn extract_groups(
&self,
pat: &str,
dtype: &DataType,
) -> Result<Series, PolarsError>
Available on crate feature extract_groups
only.
fn extract_groups( &self, pat: &str, dtype: &DataType, ) -> Result<Series, PolarsError>
extract_groups
only.Extract all capture groups from pattern and return as a struct.
Sourcefn count_matches(
&self,
pat: &str,
literal: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn count_matches( &self, pat: &str, literal: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Count all successive non-overlapping regex matches.
Sourcefn count_matches_many(
&self,
pat: &ChunkedArray<StringType>,
literal: bool,
) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn count_matches_many( &self, pat: &ChunkedArray<StringType>, literal: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Count all successive non-overlapping regex matches.
Sourcefn to_lowercase(&self) -> ChunkedArray<StringType>
fn to_lowercase(&self) -> ChunkedArray<StringType>
Modify the strings to their lowercase equivalent.
Sourcefn to_uppercase(&self) -> ChunkedArray<StringType>
fn to_uppercase(&self) -> ChunkedArray<StringType>
Modify the strings to their uppercase equivalent.
Sourcefn to_titlecase(&self) -> ChunkedArray<StringType>
Available on crate feature nightly
only.
fn to_titlecase(&self) -> ChunkedArray<StringType>
nightly
only.Modify the strings to their titlecase equivalent.
Sourcefn concat(&self, other: &ChunkedArray<StringType>) -> ChunkedArray<StringType>
fn concat(&self, other: &ChunkedArray<StringType>) -> ChunkedArray<StringType>
Concat with the values from a second StringChunked.
Sourcefn str_reverse(&self) -> ChunkedArray<StringType>
Available on crate feature string_reverse
only.
fn str_reverse(&self) -> ChunkedArray<StringType>
string_reverse
only.Reverses the string values
Sourcefn str_slice(
&self,
offset: &Column,
length: &Column,
) -> Result<ChunkedArray<StringType>, PolarsError>
fn str_slice( &self, offset: &Column, length: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>
Slice the string values.
Determines a substring starting from offset
and with length length
of each of the elements in array
.
offset
can be negative, in which case the start counts from the end of the string.
Sourcefn str_head(&self, n: &Column) -> Result<ChunkedArray<StringType>, PolarsError>
fn str_head(&self, n: &Column) -> Result<ChunkedArray<StringType>, PolarsError>
Slice the first n
values of the string.
Determines a substring starting at the beginning of the string up to offset n
of each
element in array
. n
can be negative, in which case the slice ends n
characters from
the end of the string.
Sourcefn str_tail(&self, n: &Column) -> Result<ChunkedArray<StringType>, PolarsError>
fn str_tail(&self, n: &Column) -> Result<ChunkedArray<StringType>, PolarsError>
Slice the last n
values of the string.
Determines a substring starting at offset n
of each element in array
. n
can be
negative, in which case the slice begins n
characters from the start of the string.
Sourcefn str_escape_regex(&self) -> ChunkedArray<StringType>
Available on crate feature strings
only.
fn str_escape_regex(&self) -> ChunkedArray<StringType>
strings
only.Escapes all regular expression meta characters in the string.