Skip to content

Commit

Permalink
improved remove_all_before() docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
benhovinga committed Jan 20, 2024
1 parent 36745e0 commit 766b4d5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aamva_standard/barcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ def header_length(version: int) -> int:


def remove_all_before(_str: str, indicator: str) -> str:
"""Removes all characters before the indicator in a string"""
"""
Removes all characters before the indicator in a string
Example:
remove_all_before("abc@123", "@")
returns: "@123"
Raises a ValueError if the indicator is not found in the string.
"""
if _str[0] != indicator:
try:
index = _str.index(indicator)
Expand Down

0 comments on commit 766b4d5

Please sign in to comment.