Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00)
Maven home: C:\Java\apache-maven-3.2.2
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_60\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00) Maven home: C:\Java\apache-maven-3.2.2 Java version: 1.7.0_60, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_60\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
Add:
/** * <p>Counts how many times the char appears in the given string.</p> * * <p>A {@code null} or empty ("") String input returns {@code 0}.</p> * * <pre> * StringUtils.countMatches(null, *) = 0 * StringUtils.countMatches("", *) = 0 * StringUtils.countMatches("abba", 0) = 0 * StringUtils.countMatches("abba", 'a') = 2 * StringUtils.countMatches("abba", 'b') = 2 * StringUtils.countMatches("abba", 'x') = 0 * </pre> * * @param str the CharSequence to check, may be null * @param ch the char to count * @return the number of occurrences, 0 if the CharSequence is {@code null} * @since 3.4 */ public static int countMatches(final CharSequence str, final char ch) ...