improved javadoc, and missing javadoc for new uncapitalize method added.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137847 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f90d753d06
commit
7eab1e6a6c
|
@ -28,7 +28,7 @@
|
|||
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
|
||||
* @author Gary Gregory
|
||||
* @since 2.0
|
||||
* @version $Id: WordUtils.java,v 1.12 2004/06/03 03:49:47 bayard Exp $
|
||||
* @version $Id: WordUtils.java,v 1.13 2004/06/04 03:58:27 bayard Exp $
|
||||
*/
|
||||
public class WordUtils {
|
||||
|
||||
|
@ -246,6 +246,10 @@ public static String capitalize(String str) {
|
|||
* Only the first letter of each word is changed. To change all letters to
|
||||
* the capitalized case, use {@link #capitalizeFully(String)}.</p>
|
||||
*
|
||||
* <p>The delimiters represent a set of characters understood to separate words.
|
||||
* The first string character and the first non-delimiter character after a
|
||||
* delimiter will be capitalized. </p>
|
||||
*
|
||||
* <p>A <code>null</code> input String returns <code>null</code>.
|
||||
* Capitalization uses the unicode title case, normally equivalent to
|
||||
* upper case.</p>
|
||||
|
@ -257,7 +261,7 @@ public static String capitalize(String str) {
|
|||
* </pre>
|
||||
*
|
||||
* @param str the String to capitalize, may be null
|
||||
* @param delimiters characters to capitalize afterwards
|
||||
* @param delimiters set of characters to determine capitalization
|
||||
* @return capitalized String, <code>null</code> if null String input
|
||||
* @see #uncapitalize(String)
|
||||
* @see #capitalizeFully(String)
|
||||
|
@ -329,6 +333,10 @@ public static String capitalizeFully(String str) {
|
|||
* <p>Capitalizes all the delimiter separated words in a String.
|
||||
* All letters are changed, so the resulting string will be fully changed.</p>
|
||||
*
|
||||
* <p>The delimiters represent a set of characters understood to separate words.
|
||||
* The first string character and the first non-delimiter character after a
|
||||
* delimiter will be capitalized. </p>
|
||||
*
|
||||
* <p>A <code>null</code> input String returns <code>null</code>.
|
||||
* Capitalization uses the unicode title case, normally equivalent to
|
||||
* upper case.</p>
|
||||
|
@ -340,7 +348,7 @@ public static String capitalizeFully(String str) {
|
|||
* </pre>
|
||||
*
|
||||
* @param str the String to capitalize, may be null
|
||||
* @param delimiters characters to capitalize afterwards
|
||||
* @param delimiters set of characters to determine capitalization
|
||||
* @return capitalized String, <code>null</code> if null String input
|
||||
*/
|
||||
public static String capitalizeFully(String str, char[] delimiters) {
|
||||
|
@ -372,6 +380,28 @@ public static String uncapitalize(String str) {
|
|||
return uncapitalize(str, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Uncapitalizes all the whitespace separated words in a String.
|
||||
* Only the first letter of each word is changed.</p>
|
||||
*
|
||||
* <p>The delimiters represent a set of characters understood to separate words.
|
||||
* The first string character and the first non-delimiter character after a
|
||||
* delimiter will be uncapitalized. </p>
|
||||
*
|
||||
* <p>Whitespace is defined by {@link Character#isWhitespace(char)}.
|
||||
* A <code>null</code> input String returns <code>null</code>.</p>
|
||||
*
|
||||
* <pre>
|
||||
* WordUtils.uncapitalize(null) = null
|
||||
* WordUtils.uncapitalize("") = ""
|
||||
* WordUtils.uncapitalize("I Am FINE") = "i am fINE"
|
||||
* </pre>
|
||||
*
|
||||
* @param str the String to uncapitalize, may be null
|
||||
* @param delimiters set of characters to determine uncapitalization
|
||||
* @return uncapitalized String, <code>null</code> if null String input
|
||||
* @see #capitalize(String)
|
||||
*/
|
||||
public static String uncapitalize(String str, char[] delimiters) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return str;
|
||||
|
|
Loading…
Reference in New Issue