MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / trim_string

Method trim_string

graphlite/src/functions/string_functions.rs:170–182  ·  view source on GitHub ↗

Perform the actual trimming based on mode

(input: &str, trim_chars: &str, mode: TrimMode)

Source from the content-addressed store, hash-verified

168
169 /// Perform the actual trimming based on mode
170 fn trim_string(input: &str, trim_chars: &str, mode: TrimMode) -> String {
171 match mode {
172 TrimMode::Leading => input
173 .trim_start_matches(|c: char| trim_chars.contains(c))
174 .to_string(),
175 TrimMode::Trailing => input
176 .trim_end_matches(|c: char| trim_chars.contains(c))
177 .to_string(),
178 TrimMode::Both => input
179 .trim_matches(|c: char| trim_chars.contains(c))
180 .to_string(),
181 }
182 }
183}
184
185impl Function for TrimFunction {

Callers

nothing calls this directly

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected