def remove_suffix(string: str, suffix: str) -> str:
  """Remove suffix from the end of the string if present."""
  if suffix and string.endswith(suffix):
    return string[:-len(suffix)]
  return string[:]