antlr

Class StringUtils


public class StringUtils
extends Object

Method Summary

static String
stripBack(String s, String remove)
General-purpose utility function for removing characters from back of string
static String
stripBack(String s, char c)
General-purpose utility function for removing characters from back of string
static String
stripFront(String s, String remove)
General-purpose utility function for removing characters from front of string
static String
stripFront(String s, char c)
General-purpose utility function for removing characters from front of string
static String
stripFrontBack(String src, String head, String tail)
General-purpose utility function for removing characters from the front and back of string

Method Details

stripBack

public static String stripBack(String s,
                               String remove)
General-purpose utility function for removing characters from back of string

Parameters:
s - The string to process
remove - A string containing the set of characters to remove

Returns:
The resulting string


stripBack

public static String stripBack(String s,
                               char c)
General-purpose utility function for removing characters from back of string

Parameters:
s - The string to process
c - The character to remove

Returns:
The resulting string


stripFront

public static String stripFront(String s,
                                String remove)
General-purpose utility function for removing characters from front of string

Parameters:
s - The string to process
remove - A string containing the set of characters to remove

Returns:
The resulting string


stripFront

public static String stripFront(String s,
                                char c)
General-purpose utility function for removing characters from front of string

Parameters:
s - The string to process
c - The character to remove

Returns:
The resulting string


stripFrontBack

public static String stripFrontBack(String src,
                                    String head,
                                    String tail)
General-purpose utility function for removing characters from the front and back of string

Parameters:
head - exact string to strip from head
tail - exact string to strip from tail

Returns:
The resulting string