stringutils


Standard Syntax:
     <%@ taglib prefix="su" uri="http://openutils.sf.net/openutils-stringutils" %>

XML Syntax:
     <anyxmlelement xmlns:su="http://openutils.sf.net/openutils-stringutils" />

Openutils EL functions: stringutils

Tag Library Information
Display Namestringutils
Version1.0
Short Namesu
URIhttp://openutils.sf.net/openutils-stringutils
 

Function Summary
java.lang.StringcapitaliseAllWords( java.lang.String)Capitalizes all the whitespace separated words in a String. Only the first letter of each word is changed.
java.lang.StringsubstringAfterLast( java.lang.String, java.lang.String)Gets the substring after the last occurrence of a separator. The separator is not returned. The function takes 2 parameters:
java.lang.String: the String to get a substring from, may be null
java.lang.String: the String to search for, may be null
java.lang.StringsubstringBeforeLast( java.lang.String, java.lang.String)Gets the substring before the last occurrence of a separator. The separator is not returned. The function takes 2 parameters:
java.lang.String: the String to get a substring from, may be null
java.lang.String: the String to search for, may be null
booleanisBlank( java.lang.String )Checks if a String is whitespace, empty ("") or null.
java.lang.StringrandomAlphanumeric( int)Creates a random string whose length is the number of characters specified.
intrandomInt( int)Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), from the Math.random() sequence.
java.lang.StringunescapeXml( java.lang.String)Unescapes a String
java.lang.Stringspace( )Output a white space.
java.lang.Stringtab( )Output a tab character.
java.lang.Stringnewline( )Output a newline character.
java.lang.StringescJsTxt( java.lang.String, boolean)Escapes a javascript string. If "true" is passed as parameter, the string is between ", if false is bewteen '
java.lang.StringadaptStringLength( java.lang.String, int, java.lang.String)Crops a String to a given length, adding a suffix (for example "...") if needed. The function takes 3 parameters:
java.lang.String: the string to be adapted
int: the number of chars of the string to be kept
java.lang.String: the suffix to be added if the string is not complete
java.lang.StringstripHtmlTags( java.lang.String)Strip any html tag from a String.
java.lang.String[]splitNewlines( java.lang.String)Splits the given strings on newlines
java.lang.String[]splitOnTabs( java.lang.String)Splits the given string on tab characters
java.lang.Stringstrip( java.lang.String)Strips whitespaces from the start and the end of a String
java.lang.StringdefaultIfEmpty( java.lang.String, java.lang.String)Returns either the passed in String, or if the String is empty or null, the value of defaultStr. The function takes 2 parameters:
java.lang.String: the String to check, may be null
java.lang.String: the default String to return if the string to check is null of empty
booleanendsWith( java.lang.String, java.lang.String)A wrapper around java.lang.String#endsWith(..). Tests if this string ends with the specified suffix. The function takes 2 parameters:
java.lang.String: string to evaluate
java.lang.String: suffix
java.lang.Stringshorten( java.lang.String, int, int, java.lang.String)Shorten a text with a number of lines and a number of chars per line to be displayed. Display ellipses the line is shortened. The function takes 4 parameters:
java.lang.String: original text
int: number of lines
int: number of chars per line java.lang.String: optional ellipses ('...') to display optional ellipses where the line is shortened.
java.lang.LongtoLong( java.lang.String)Parse a number, passed as String, and return his Long
java.lang.LongtoRoundedLong( java.lang.String)Parse a number, passed as String, and return his closest rounding as a long (or 0L if parse fails)
java.lang.LongtoFloorLong( java.lang.String)Parse a double, passed as String, and return his floor as a long (or 0L if parse fails)
java.lang.LongtoCeilLong( java.lang.String)Parse a double, passed as String, and return his ceil as a long (or 0L if parse fails)
java.lang.Stringurlencode( java.lang.String)Enconde a url in UTF-8 format
java.lang.Stringurldecode( java.lang.String)Decode a url in UTF-8 format
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.