org.jsoup.helper
Class StringUtil

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

public final class StringUtil
extends java.lang.Object

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


Constructor Summary
StringUtil()
           
 
Method Summary
static boolean in(java.lang.String needle, java.lang.String... haystack)
           
static boolean isBlank(java.lang.String string)
          Tests if a string is blank: null, emtpy, or only whitespace (" ", \r\n, \t, etc)
static boolean isNumeric(java.lang.String string)
          Tests if a string is numeric, i.e.
static boolean isWhitespace(int c)
          Tests if a code point is "whitespace" as defined in the HTML spec.
static java.lang.String join(java.util.Collection strings, java.lang.String sep)
          Join a collection of strings by a seperator
static java.lang.String join(java.util.Iterator strings, java.lang.String sep)
          Join a collection of strings by a seperator
static java.lang.String normaliseWhitespace(java.lang.String string)
           
static java.lang.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 java.lang.String join(java.util.Collection strings,
                                    java.lang.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 java.lang.String join(java.util.Iterator strings,
                                    java.lang.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 java.lang.String padding(int width)
Returns space padding

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

isBlank

public static boolean isBlank(java.lang.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(java.lang.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

isWhitespace

public static boolean isWhitespace(int c)
Tests if a code point is "whitespace" as defined in the HTML spec.

Parameters:
c - code point to test
Returns:
true if code point is whitespace, false otherwise

normaliseWhitespace

public static java.lang.String normaliseWhitespace(java.lang.String string)

in

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


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