MCPcopy Create free account
hub / github.com/apache/datafusion / trim

Method trim

datafusion/functions/src/string/common.rs:67–74  ·  view source on GitHub ↗
(input: &'a str, pattern: &[char])

Source from the content-addressed store, hash-verified

65impl Trimmer for TrimLeft {
66 #[inline]
67 fn trim<'a>(input: &'a str, pattern: &[char]) -> (&'a str, u32) {
68 if pattern.len() == 1 && pattern[0].is_ascii() {
69 return Self::trim_ascii_char(input, pattern[0] as u8);
70 }
71 let trimmed = input.trim_start_matches(pattern);
72 let offset = (input.len() - trimmed.len()) as u32;
73 (trimmed, offset)
74 }
75
76 #[inline]
77 fn trim_ascii_char(input: &str, byte: u8) -> (&str, u32) {

Callers 15

parse_metadata_lineFunction · 0.80
parse_main_rs_docsFunction · 0.80
is_non_blank_doc_lineFunction · 0.80
remove_paddingMethod · 0.80
test_stats_displayFunction · 0.80
get_plan_stringFunction · 0.80
check_resultFunction · 0.80
compare_batchesFunction · 0.80
get_tpch_query_sqlFunction · 0.80
spark_next_dayFunction · 0.80

Calls 1

lenMethod · 0.45