package fanch.multijeu.common.utils;

import java.text.Normalizer;

public class StringUtils {
    public static int countVoyelle(String s)
    {
        int x = 0;
        int l=s.length();
        for(int i=0; i<l; i++)
            if(LetterUtils.isVoyelle(s.charAt(i)))
                x++;
        return x;
    }

    public static int countConsonne(String s)
    {
        int x = 0;
        int l=s.length();
        for(int i=0; i<l; i++)
            if(LetterUtils.isConsonne(s.charAt(i)))
                x++;
        return x;
    }

    public static String toAscii(String c)
    {
        String s = Normalizer.normalize(c, Normalizer.Form.NFD);
        return s.replaceAll("[^\\p{ASCII}]", "");
    }
}
