Java String Char Count countChars(String data)

Here you can find the source of countChars(String data)

Description

Counts the number of characters in this String.

License

Open Source License

Declaration

public static Integer countChars(String data) 

Method Source Code

//package com.java2s;
/*/* w w  w  .  ja  v a 2s .  c o  m*/
 * Copyright (c) Mirth Corporation. All rights reserved.
 * 
 * http://www.mirthcorp.com
 * 
 * The software in this package is published under the terms of the MPL license a copy of which has
 * been included with this distribution in the LICENSE.txt file.
 */

public class Main {
    /**
     * Counts the number of characters in this String.
     */
    public static Integer countChars(String data) {
        if (data == null) {
            return null;
        }
        return data.length();
    }
}

Related

  1. countChar(String string, char c, int pos, boolean forwards)
  2. countChar(String string, String c)
  3. countChar(String text, char c)
  4. countChar(String text, char ch)
  5. countChar(StringBuffer sb, char ch)
  6. countChars(String input)
  7. countChars(String s, boolean countDigits, boolean countLetters, boolean countOthers)
  8. countChars(String s, char c)
  9. countChars(String s, char c)