public final class

StringUtil

extends Object
java.lang.Object
   ↳ org.jsoup.helper.StringUtil

Class Overview

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

Summary

Public Constructors
StringUtil()
Public Methods
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
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StringUtil ()

Public Methods

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

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

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

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

public static String normaliseWhitespace (String string)

public static String padding (int width)

Returns space padding

Parameters
width amount of padding desired
Returns
  • string of spaces * width