org.jsoup.helper
Class StringUtil

java.lang.Object
  extended by org.jsoup.helper.StringUtil

public final class StringUtil
extends Object

A minimal String utility class. Designed for interal jsoup use only.


Constructor Summary
StringUtil()
           
 
Method Summary
static boolean in(String needle, String... haystack)
           
static boolean isBlank(String string)
          Tests if a string is blank: null, emtpy, or only whitespace (" ", \r\n, \t, etc)
static boolean isNumeric(String string)
          Tests if a string is numeric, i.e.
static String join(Collection strings, String sep)
          Join a collection of strings by a seperator
static String join(Iterator strings, String sep)
          Join a collection of strings by a seperator
static String normaliseWhitespace(String string)
           
static String padding(int width)
          Returns space padding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

join

public static String join(Collection strings,
                          String sep)
Join a collection of strings by a seperator

Parameters:
strings - collection of string objects
sep - string to place between strings
Returns:
joined string

join

public static String join(Iterator strings,
                          String sep)
Join a collection of strings by a seperator

Parameters:
strings - iterator of string objects
sep - string to place between strings
Returns:
joined string

padding

public static String padding(int width)
Returns space padding

Parameters:
width - amount of padding desired
Returns:
string of spaces * width

isBlank

public static boolean isBlank(String string)
Tests if a string is blank: null, emtpy, or only whitespace (" ", \r\n, \t, etc)

Parameters:
string - string to test
Returns:
if string is blank

isNumeric

public static boolean isNumeric(String string)
Tests if a string is numeric, i.e. contains only digit characters

Parameters:
string - string to test
Returns:
true if only digit chars, false if empty or null or contains non-digit chrs

normaliseWhitespace

public static String normaliseWhitespace(String string)

in

public static boolean in(String needle,
                         String... haystack)


Copyright © 2009-2011 Jonathan Hedley. All Rights Reserved.