Example usage for org.apache.commons.lang.math NumberUtils stringToInt

List of usage examples for org.apache.commons.lang.math NumberUtils stringToInt

Introduction

In this page you can find the example usage for org.apache.commons.lang.math NumberUtils stringToInt.

Prototype

public static int stringToInt(String str) 

Source Link

Document

Convert a String to an int, returning zero if the conversion fails.

If the string is null, zero is returned.

 NumberUtils.stringToInt(null) = 0 NumberUtils.stringToInt("")   = 0 NumberUtils.stringToInt("1")  = 1 

Usage

From source file:org.apache.roller.weblogger.ui.tags.LeftTag.java

public String changeString(String text) throws JspException {
    return StringUtils.left(text, NumberUtils.stringToInt(count));
}

From source file:org.apache.roller.weblogger.ui.tags.TruncateNicelyTag.java

public String changeString(String text) throws JspException {

    int l = NumberUtils.stringToInt(lower);
    int u = NumberUtils.stringToInt(upper);

    return StringW.truncateNicely(text, l, u, this.appendToEnd);
}

From source file:org.apache.roller.weblogger.ui.tags.WordWrapTag.java

public String changeString(String text) throws JspException {
    return StringW.wordWrap(text, NumberUtils.stringToInt(width), delimiter, split, delimiterInside);
}