def tokenize_by_camel_case(string, token):
    """
    Tokenize the given String by camel case replacing upper case characters by
    the given token.
    """
    if not string:
        return string
    result = [string[0:1]]
    index = 1
    length = len(string)
    while index < length:
        character = string[index].upper()
        if character != ' ' and character == string[index]:
            result.append(token)
            result.append(string[index].lower())
        else:
            result.append(string[index])
        index += 1
    return ''.join(result)
