import re


def to_snake(string):
    """
    Converts to snake case.

    :param string: A target string.
    :return: Converted string.
    """

    return re.sub(r'(?<!^)(?=[A-Z])', '_', string).lower()