Java String Length Get lengthUCP(String s)

Here you can find the source of lengthUCP(String s)

Description

Returns the number of Unicode code points in the given string.

License

Open Source License

Parameter

Parameter Description
s The string.

Return

The number of Unicode code points.

Declaration


public static int lengthUCP(String s) 

Method Source Code

//package com.java2s;
/* $License$ *//*  w  ww .  j av  a  2  s .  c  o  m*/

public class Main {
    /**
     * Returns the number of Unicode code points in the given string.
     *
     * @param s The string.
     *
     * @return The number of Unicode code points.
     */

    public static int lengthUCP(String s) {
        return s.codePointCount(0, s.length());
    }
}

Related

  1. lengthOfCommonPrefix(String s1, String s2)
  2. lengthOfStartingWhitespace(String s)
  3. lengthOfString(final String cadena)
  4. lengthTokensField(String fieldName)
  5. lengthToString(double value, boolean proportional)
  6. lengthUnicode(String s)
  7. lengthWithinLimits(String string, int min, int max)