Java String Length Get length(String str)

Here you can find the source of length(String str)

Description

returns the length of the given string.

License

Open Source License

Parameter

Parameter Description
str a parameter

Declaration

public static int length(String str) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*  w ww.java 2s  .c  om*/
     * returns the length of the given string.
     * 0 if str is null
     * @param str
     * @return
     */
    public static int length(String str) {
        return str == null ? 0 : str.length();
    }
}

Related

  1. length(String s)
  2. length(String schema)
  3. length(String source)
  4. length(String str)
  5. length(String str)
  6. length(String string)
  7. length(String string)
  8. length(String... args)
  9. lengthBetween(String param, int minLength, int maxLength)