Java String Length Get lengthIntegers(String str)

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

Description

Length string

License

Open Source License

Parameter

Parameter Description
str a parameter

Declaration

public static int lengthIntegers(String str) 

Method Source Code

//package com.java2s;
/*/*from w ww  . j  av  a  2s.c  o  m*/
 * Copyright (C) 2009-2015 SM2 SOFTWARE & SERVICES MANAGEMENT
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program has been created in the hope that it will be useful.
 * It is distributed WITHOUT ANY WARRANTY of any Kind,
 * without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 * For more information, please contact SM2 Software & Services Management.
 * Mail: info@talaia-openppm.com
 * Web: http://www.talaia-openppm.com
 *
 * Module: utils
 * File: StringUtil.java
 * Create User: javier.hernandez
 * Create Date: 06/03/2015 14:35:37
 */

public class Main {
    /**
     * Length string
     *
     * @param str
     * @return
     */
    public static int lengthIntegers(String str) {

        int length = 0;

        if (str != null && !str.equals("null") && !str.equalsIgnoreCase("")) { //TODO !str.equals("null") is for IE
            String[] strArray = str.split(",");
            length = strArray.length;
        }
        return length;
    }
}

Related

  1. lengthExpandedTabs(String string, int toIdx, int tabWidth)
  2. lengthExpression(final String operand, final long length)
  3. lengthField(String propertyName)
  4. lengthFormat(String str, int maxLength)
  5. lengthIfAllAlpha(String str)
  6. lengthMinusColors(String thisStr)
  7. lengthMinusTrailingWhitespace(String line)
  8. lengthOfCommonPrefix(String s1, String s2)
  9. lengthOfStartingWhitespace(String s)