call_string_method

Function call_string_method 

Source
pub fn call_string_method(
    s: &str,
    method: &str,
    args: &[Value],
) -> GentResult<Value>
Expand description

Call a method on a string value

§Arguments

  • s - The string to call the method on
  • method - The method name
  • args - Arguments to the method

§Supported Methods

  • length() - Returns the character count
  • trim() - Removes leading/trailing whitespace
  • toLowerCase() - Converts to lowercase
  • toUpperCase() - Converts to uppercase
  • contains(substr) - Checks if substring exists
  • startsWith(prefix) - Checks if string starts with prefix
  • endsWith(suffix) - Checks if string ends with suffix
  • split(separator) - Splits string by separator
  • replace(old, new) - Replaces first occurrence