Struct polars_plan::dsl::string::StringNameSpace
source · [−]pub struct StringNameSpace(_);
Expand description
Specialized expressions for Series
of DataType::Utf8
.
Implementations
sourceimpl StringNameSpace
impl StringNameSpace
sourcepub fn contains_literal<S: AsRef<str>>(self, pat: S) -> Expr
pub fn contains_literal<S: AsRef<str>>(self, pat: S) -> Expr
Check if a string value contains a literal substring.
sourcepub fn contains<S: AsRef<str>>(self, pat: S) -> Expr
pub fn contains<S: AsRef<str>>(self, pat: S) -> Expr
Check if a string value contains a Regex substring.
sourcepub fn ends_with<S: AsRef<str>>(self, sub: S) -> Expr
pub fn ends_with<S: AsRef<str>>(self, sub: S) -> Expr
Check if a string value ends with the sub
string.
sourcepub fn starts_with<S: AsRef<str>>(self, sub: S) -> Expr
pub fn starts_with<S: AsRef<str>>(self, sub: S) -> Expr
Check if a string value starts with the sub
string.
sourcepub fn extract(self, pat: &str, group_index: usize) -> Expr
pub fn extract(self, pat: &str, group_index: usize) -> Expr
Extract a regex pattern from the a string value.
sourcepub fn zfill(self, alignment: usize) -> Expr
Available on crate feature string_justify
only.
pub fn zfill(self, alignment: usize) -> Expr
string_justify
only.Return a copy of the string left filled with ASCII ‘0’ digits to make a string of length width.
A leading sign prefix (‘+’/‘-’) is handled by inserting the padding after the sign character
rather than before.
The original string is returned if width is less than or equal to s.len()
.
sourcepub fn ljust(self, width: usize, fillchar: char) -> Expr
Available on crate feature string_justify
only.
pub fn ljust(self, width: usize, fillchar: char) -> Expr
string_justify
only.Return the string left justified in a string of length width.
Padding is done using the specified fillchar
,
The original string is returned if width is less than or equal to s.len()
.
sourcepub fn rjust(self, width: usize, fillchar: char) -> Expr
Available on crate feature string_justify
only.
pub fn rjust(self, width: usize, fillchar: char) -> Expr
string_justify
only.Return the string right justified in a string of length width.
Padding is done using the specified fillchar
,
The original string is returned if width is less than or equal to s.len()
.
sourcepub fn extract_all(self, pat: &str) -> Expr
pub fn extract_all(self, pat: &str) -> Expr
Extract each successive non-overlapping match in an individual string as an array
sourcepub fn count_match(self, pat: &str) -> Expr
pub fn count_match(self, pat: &str) -> Expr
Count all successive non-overlapping regex matches.
pub fn strptime(self, options: StrpTimeOptions) -> Expr
sourcepub fn concat(self, delimiter: &str) -> Expr
pub fn concat(self, delimiter: &str) -> Expr
Concat the values into a string array.
Arguments
delimiter
- A string that will act as delimiter between values.
sourcepub fn split(self, by: &str) -> Expr
pub fn split(self, by: &str) -> Expr
Split the string by a substring. The resulting dtype is List<Utf8>
.
sourcepub fn split_inclusive(self, by: &str) -> Expr
pub fn split_inclusive(self, by: &str) -> Expr
Split the string by a substring and keep the substring. The resulting dtype is List<Utf8>
.
sourcepub fn split_exact(self, by: &str, n: usize) -> Expr
pub fn split_exact(self, by: &str, n: usize) -> Expr
Split exactly n
times by a given substring. The resulting dtype is DataType::Struct
.
sourcepub fn split_exact_inclusive(self, by: &str, n: usize) -> Expr
pub fn split_exact_inclusive(self, by: &str, n: usize) -> Expr
Split exactly n
times by a given substring and keep the substring.
The resulting dtype is DataType::Struct
.
sourcepub fn splitn(self, by: &str, n: usize) -> Expr
pub fn splitn(self, by: &str, n: usize) -> Expr
Split by a given substring, returning exactly n
items. If there are more possible splits,
keeps the remainder of the string intact. The resulting dtype is DataType::Struct
.
sourcepub fn replace(self, pat: Expr, value: Expr, literal: bool) -> Expr
pub fn replace(self, pat: Expr, value: Expr, literal: bool) -> Expr
Replace values that match a regex pat
with a value
.
sourcepub fn replace_all(self, pat: Expr, value: Expr, literal: bool) -> Expr
pub fn replace_all(self, pat: Expr, value: Expr, literal: bool) -> Expr
Replace all values that match a regex pat
with a value
.
sourcepub fn to_lowercase(self) -> Expr
pub fn to_lowercase(self) -> Expr
Convert all characters to lowercase.
sourcepub fn to_uppercase(self) -> Expr
pub fn to_uppercase(self) -> Expr
Convert all characters to uppercase.