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> { ... }
}
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 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.