def get_whitespace_prefix(string):
    """Returns the longest prefix of a given string composed only of tabs and spaces."""
    index = 0
    prefix = ""
    while index < len(string) and string[index] in "\t ":
        prefix += string[index]
        index += 1
    return prefix