package a.b.a.f;

import a.a.a.b;

public class i {

    /* renamed from: a  reason: collision with root package name */
    private static final String f23a = "EmojiUtils";

    public static int a(String str) {
        if (str == null) {
            return 0;
        }
        return str.codePointCount(0, str.length());
    }

    public static String a(String str, int i, int i2) {
        if (str == null) {
            return null;
        }
        try {
            return str.substring(str.offsetByCodePoints(0, i), str.offsetByCodePoints(0, i2));
        } catch (Exception e) {
            b.e(f23a, "Get substring by codePoint failed.", e);
            return str.substring(i, i2);
        }
    }
}
