Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 10510 invoked from network); 24 Dec 2009 06:35:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Dec 2009 06:35:55 -0000 Received: (qmail 78667 invoked by uid 500); 24 Dec 2009 06:35:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 78254 invoked by uid 500); 24 Dec 2009 06:35:52 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 78244 invoked by uid 99); 24 Dec 2009 06:35:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Dec 2009 06:35:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Dec 2009 06:35:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9D737234C04C for ; Wed, 23 Dec 2009 22:35:29 -0800 (PST) Message-ID: <1285409593.1261636529630.JavaMail.jira@brutus> Date: Thu, 24 Dec 2009 06:35:29 +0000 (UTC) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (LANG-573) Add new APIs to StringUtils (countLowerCase, countUpperCase, countDigits) In-Reply-To: <1055470312.1261380978108.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-573: ------------------------------- Seems fair enough. Code needs javadoc, to be null-safe and to have unit tests before it can be added. > Add new APIs to StringUtils (countLowerCase, countUpperCase, countDigits) > ------------------------------------------------------------------------- > > Key: LANG-573 > URL: https://issues.apache.org/jira/browse/LANG-573 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* > Reporter: Alvin Chee > > private static int countUpperCase(String s) { > int cLen = s.length(); > int count = 0; > for (int i = 0; i < cLen; i++) { > if (Character.isUpperCase(s.charAt(i))) > count++; > } > return count; > } > private static int countLowerCase(String s) { > int cLen = s.length(); > int count = 0; > for (int i = 0; i < cLen; i++) { > if (Character.isLowerCase(s.charAt(i))) > count++; > } > return count; > } > private static int countDigits(String s) { > int cLen = s.length(); > int count = 0; > for (int i = 0; i < cLen; i++) { > if (Character.isDigit(s.charAt(i))) > count++; > } > return count; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.