polars::prelude

Trait StringNameSpaceImpl

source
pub trait StringNameSpaceImpl: AsString {
Show 41 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 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> { ... }
}
Available on crate feature polars-ops only.

Provided Methods§

source

fn hex_decode(&self) -> Result<ChunkedArray<StringType>, PolarsError>

Available on non-crate feature binary_encoding only.
source

fn hex_encode(&self) -> ChunkedArray<StringType>

Available on crate feature string_encoding only.
source

fn base64_decode(&self) -> Result<ChunkedArray<StringType>, PolarsError>

Available on non-crate feature binary_encoding only.
source

fn base64_encode(&self) -> ChunkedArray<StringType>

Available on crate feature string_encoding only.
source

fn to_integer( &self, base: &ChunkedArray<UInt32Type>, strict: bool, ) -> Result<ChunkedArray<Int64Type>, PolarsError>

Available on crate feature string_to_integer only.
source

fn contains_chunked( &self, pat: &ChunkedArray<StringType>, literal: bool, strict: bool, ) -> Result<ChunkedArray<BooleanType>, PolarsError>

source

fn find_chunked( &self, pat: &ChunkedArray<StringType>, literal: bool, strict: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>

source

fn str_len_chars(&self) -> ChunkedArray<UInt32Type>

Get the length of the string values as number of chars.

source

fn str_len_bytes(&self) -> ChunkedArray<UInt32Type>

Get the length of the string values as number of bytes.

source

fn contains( &self, pat: &str, strict: bool, ) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check if strings contain a regex pattern.

source

fn contains_literal( &self, lit: &str, ) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check if strings contain a given literal

source

fn find_literal( &self, lit: &str, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>

Return the index position of a literal substring in the target string.

source

fn find( &self, pat: &str, strict: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>

Return the index position of a regular expression substring in the target string.

source

fn replace<'a>( &'a self, pat: &str, val: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>

Replace the leftmost regex-matched (sub)string with another string

source

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

source

fn replace_all( &self, pat: &str, val: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>

Replace all regex-matched (sub)strings with another string

source

fn replace_literal_all<'a>( &'a self, pat: &str, val: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>

Replace all matching literal (sub)strings with another string

source

fn extract( &self, pat: &ChunkedArray<StringType>, group_index: usize, ) -> Result<ChunkedArray<StringType>, PolarsError>

Extract the nth capture group from pattern.

source

fn extract_all(&self, pat: &str) -> Result<ChunkedArray<ListType>, PolarsError>

Extract each successive non-overlapping regex match in an individual string as an array.

source

fn strip_chars( &self, pat: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>

source

fn strip_chars_start( &self, pat: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>

source

fn strip_chars_end( &self, pat: &Column, ) -> Result<ChunkedArray<StringType>, PolarsError>

source

fn strip_prefix( &self, prefix: &ChunkedArray<StringType>, ) -> ChunkedArray<StringType>

source

fn strip_suffix( &self, suffix: &ChunkedArray<StringType>, ) -> ChunkedArray<StringType>

source

fn split_exact( &self, by: &ChunkedArray<StringType>, n: usize, ) -> Result<ChunkedArray<StructType>, PolarsError>

Available on crate feature dtype-struct only.
source

fn split_exact_inclusive( &self, by: &ChunkedArray<StringType>, n: usize, ) -> Result<ChunkedArray<StructType>, PolarsError>

Available on crate feature dtype-struct only.
source

fn splitn( &self, by: &ChunkedArray<StringType>, n: usize, ) -> Result<ChunkedArray<StructType>, PolarsError>

Available on crate feature dtype-struct only.
source

fn split(&self, by: &ChunkedArray<StringType>) -> ChunkedArray<ListType>

source

fn split_inclusive( &self, by: &ChunkedArray<StringType>, ) -> ChunkedArray<ListType>

source

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.

source

fn extract_groups( &self, pat: &str, dtype: &DataType, ) -> Result<Series, PolarsError>

Available on crate feature extract_groups only.

Extract all capture groups from pattern and return as a struct.

source

fn count_matches( &self, pat: &str, literal: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>

Count all successive non-overlapping regex matches.

source

fn count_matches_many( &self, pat: &ChunkedArray<StringType>, literal: bool, ) -> Result<ChunkedArray<UInt32Type>, PolarsError>

Count all successive non-overlapping regex matches.

source

fn to_lowercase(&self) -> ChunkedArray<StringType>

Modify the strings to their lowercase equivalent.

source

fn to_uppercase(&self) -> ChunkedArray<StringType>

Modify the strings to their uppercase equivalent.

source

fn to_titlecase(&self) -> ChunkedArray<StringType>

Available on crate feature nightly only.

Modify the strings to their titlecase equivalent.

source

fn concat(&self, other: &ChunkedArray<StringType>) -> ChunkedArray<StringType>

Concat with the values from a second StringChunked.

source

fn str_reverse(&self) -> ChunkedArray<StringType>

Available on crate feature string_reverse only.

Reverses the string values

source

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.

source

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.

source

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.

Implementors§