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

Method extract_trim_char

graphlite/src/functions/string_functions.rs:292–303  ·  view source on GitHub ↗

Helper method to extract trim character from value

(&self, value: &Value)

Source from the content-addressed store, hash-verified

290
291 /// Helper method to extract trim character from value
292 fn extract_trim_char(&self, value: &Value) -> FunctionResult<char> {
293 let trim_char = if let Some(s) = value.as_string() {
294 if s.is_empty() {
295 ' ' // Default to space if empty string
296 } else {
297 s.chars().next().unwrap_or(' ')
298 }
299 } else {
300 ' ' // Default to space for non-string values
301 };
302 Ok(trim_char)
303 }
304}
305
306// ==============================================================================

Callers 1

executeMethod · 0.80

Calls 3

nextMethod · 0.80
as_stringMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected