(string, replace='', language=None, version=-1)
Replace unicode emoji in a customizable string.

    :param string: String contains unicode characters. MUST BE UNICODE.
    :param replace: (optional) replace can be either a string or a callable;
        If it is a callable, it's passed the unicode emoji and the data dict from
        emoji.EMOJI_DATA and must return a replacement string to be used.
        replace(str, dict) -> str
    :param version: (optional) Max version. If set to an Emoji Version,
        only emoji above this version will be replaced.
    :param language: (optional) Parameter is no longer used
Replace unicode emoji in a customizable string.
Replace unicode emoji in a customizable string .
def replace_emoji(string, replace='', language=None, version=-1):
    """Replace unicode emoji in a customizable string.

    :param string: String contains unicode characters. MUST BE UNICODE.
    :param replace: (optional) replace can be either a string or a callable;
        If it is a callable, it's passed the unicode emoji and the data dict from
        emoji.EMOJI_DATA and must return a replacement string to be used.
        replace(str, dict) -> str
    :param version: (optional) Max version. If set to an Emoji Version,
        only emoji above this version will be replaced.
    :param language: (optional) Parameter is no longer used
    """

    if version > -1:
        def f(emj, emj_data):
            if emj_data['E'] <= version:
                return emj  # Do not replace emj
            if callable(replace):
                return replace(emj, emj_data)
            return str(replace)

        return demojize(string, use_aliases=False, language='en', version=-1, handle_version=f)
    else:
        return demojize(string, use_aliases=False, language='en', version=-1, handle_version=replace)
def replace_emoji ( string , replace = '' , language = None , version = - 1 ) : if version > - 1 : def f ( emj , emj_data ) : if emj_data [ 'E' ] <= version : return emj # Do not replace emj if callable ( replace ) : return replace ( emj , emj_data ) return str ( replace ) return demojize ( string , use_aliases = False , language = 'en' , version = - 1 , handle_version = f ) else : return demojize ( string , use_aliases = False , language = 'en' , version = - 1 , handle_version = replace )