from typing import Union
from typing import Tuple
from typing import Sequence


def extract_string_from_subscript(
        subscript: Union[None, int, slice, Tuple]) -> Tuple[Union[None, int, slice, Sequence], Tuple[str, ...]]:
    """
    Extracts any string elements (stripped and made all lowercase) from subscript entries.

    Parameters
    ----------
    subscript : None|str|int|slice|Sequence

    Returns
    -------
    subscript: None|int|slice|Sequence
        With string entries removed
    strings : Tuple[str, ...]
        The string entries, stripped and made all lower case.
    """

    string_entries = []
    if isinstance(subscript, str):
        string_entries.append(subscript.strip().lower())
        subscript = None
    elif isinstance(subscript, Sequence):
        new_subscript = []
        for entry in subscript:
            if isinstance(entry, str):
                string_entries.append(entry.strip().lower())
            else:
                new_subscript.append(entry)
        if len(string_entries) > 0:
            subscript = tuple(new_subscript)
    return subscript, tuple(string_entries)