neutralts::utils

Function strip_prefix_suffix

Source
pub fn strip_prefix_suffix<'a>(
    str: &'a str,
    prefix: &'a str,
    suffix: &'a str,
) -> &'a str
Expand description

Removes a prefix and suffix from a string slice.

§Arguments

  • str: The input string slice.
  • prefix: The prefix to remove.
  • suffix: The suffix to remove.

§Returns

  • A new string slice with the prefix and suffix removed, or the original string if not found.