import re


def convert_camelcase(s):
    """
    Convert:

    - 'ABC' -> 'abc'
    - 'abcDef' -> 'abc-def'
    - 'abcXDef' -> 'abc-x-def'

    Credits to https://stackoverflow.com/questions/1175208

    :param str s:
    :rtype: str
    """
    s = re.sub('(.)([A-Z][a-z]+)', r'\1-\2', s)
    return re.sub('([a-z0-9])([A-Z])', r'\1-\2', s).lower()