Java Unicode unicodeCount(String sStr)

Here you can find the source of unicodeCount(String sStr)

Description

unicode Count

License

Apache License

Declaration

public static int unicodeCount(String sStr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static int unicodeCount(String sStr) {
        if (sStr == null || sStr.equals("")) {
            return 0;
        }/* w  w  w.  j av a 2 s.  c om*/

        int count = 0;
        for (int i = 0; i < sStr.length(); i++) {
            if ((int) sStr.charAt(i) > 255) {
                count++;
            }
        }

        return count;
    }
}

Related

  1. Unicode2GBK(String dataStr)
  2. unicode2native(String s)
  3. unicodeChar(char a, char b, char c, char d)
  4. unicodeCodepointToString(char cp, boolean shortenIfPossible, String prefix, boolean upperCase)
  5. unicodeConvert(String str)
  6. unicodeEncode(String s)
  7. unicodeHTMLEscape(final String s)
  8. unicodePreservingIndex(String str, int index)
  9. unicodePreservingSubstring(String str, int begin, int end)