fn string_view_trim<'a>(
trim_func: fn(&'a str, &'a str) -> (&'a str, u32),
args: &'a [ArrayRef],
) -> Result<ArrayRef>Expand description
Applies the trim function to the given string view array(s) and returns a new string view array with the trimmed values.
§trim_func: The function to apply to each string view.
§Arguments
- The original string
- the pattern to trim
§Returns
- trimmed str (must be a substring of the first argument)
- start offset, needed in
string_view_trim
§Examples
For ltrim:
fn(" abc", " ") -> ("abc", 2)fn("abd", " ") -> ("abd", 0)
For btrim:
fn(" abc ", " ") -> ("abc", 2)fn("abd", " ") -> ("abd", 0)