from typing import Union
from typing import List


def list_of_strs(
    string: str, delimiter: Union[str, None] = None, strip=True
) -> List[str]:
    """Cast a string to a list of strings.

    Args:
        string: String to be converted to a list of str's.
        delimiter: Delimiter between str's in the string.
            Default is to split with any whitespace string (see str.split() method).
        strip: Whether to strip the substrings (i.e. remove leading and trailing
            whitespaces after the split with a delimiter that is not whitespace).
    """
    if strip:
        return [s.strip() for s in string.split(sep=delimiter)]
    return string.split(sep=delimiter)