Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace emoji with provided character #85

Closed
rahulupadhyay opened this issue Oct 3, 2017 · 3 comments
Closed

Replace emoji with provided character #85

rahulupadhyay opened this issue Oct 3, 2017 · 3 comments

Comments

@rahulupadhyay
Copy link

rahulupadhyay commented Oct 3, 2017

THIS IS NOT AN ISSUE. BUT I DON"T KNOW HOW TO ADD LABEL.

I really like this project it helps me a lot.

I'm suppose to change emoji with particular character say "?".

I've achieved it by creating method :

/**
     * Replace all emojis with character
     *
     * @param str the string to process
     * @param chr the character to be replaced
     * @return the string with replaced character
     */
    public static String replaceAllEmojis(String str, final String chr) {
        EmojiParser.EmojiTransformer emojiTransformer = new EmojiParser.EmojiTransformer() {
            public String transform(EmojiParser.UnicodeCandidate unicodeCandidate) {
                return chr;
            }
        };

        return parseFromUnicode(str, emojiTransformer);
    }

Can you please add this function? I'm using it and its working fine.

Thanks.

@cbedoy
Copy link
Contributor

cbedoy commented Oct 19, 2017

Why don't create a pull request ?

@vdurmont
Copy link
Owner

yeah a pull request would be fine!

cbedoy added a commit to cbedoy/emoji-java that referenced this issue Nov 3, 2017
@ewencluley
Copy link

I see this change has been merged after the 4.0.0 release- could you perform another release to make this functionality available please. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants