Helper method to extract trim character from value
(&self, value: &Value)
| 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 | // ============================================================================== |