hutch_python.utils.strip_prefix

hutch_python.utils.strip_prefix(name, strip_text)

Strip the first section of an underscore-separated name.

If the first section matches the strip_text, we’ll remove it. Otherwise, the object will remain unchanged.

Parameters:
  • name (str) – underscore_separated_name to strip from

  • strip_text (str) – Text to strip from the name, if it matches the first segment

Returns:

stripped – The name, modified or unmodified.

Return type:

str