View | Details | Raw Unified | Return to bug 30841
Collapse All | Expand All

(-)src/org/apache/taglibs/string/CapitalizeTag.java (-2 / +11 lines)
Lines 15-21 Link Here
15
 */
15
 */
16
package org.apache.taglibs.string;
16
package org.apache.taglibs.string;
17
17
18
import org.apache.commons.lang.WordUtils;
19
import javax.servlet.jsp.JspException;
18
import javax.servlet.jsp.JspException;
20
19
21
/**
20
/**
Lines 32-38 Link Here
32
31
33
32
34
    public String changeString(String text) throws JspException {
33
    public String changeString(String text) throws JspException {
35
		return WordUtils.capitalize( text );
34
        if(text ==  null  || text.length() == 0) {
35
            return text;
36
        }
37
38
        String capitalized = "";
39
        if(text.length() > 1)  {
40
            capitalized = text.substring(1);
41
        }
42
43
        capitalized = Character.toTitleCase(text.charAt(0)) + capitalized;
44
        return  capitalized;
36
    }
45
    }
37
46
38
    public void initAttributes() {
47
    public void initAttributes() {

Return to bug 30841