com.mancrd.ahah.commons.utils
Class StringUtils

java.lang.Object
  extended by com.mancrd.ahah.commons.utils.StringUtils

public final class StringUtils
extends Object

This class performs various tasks on Strings

Author:
alexnugent

Method Summary
static String addWhiteSpaceToEnd(String theString, int finalLength)
          Adds whitespace to the end of given String
static String formatDate_MySQL(Date date)
           
static String formatDate_yyyyMMdd(Date date)
           
static String formatPercentage(double number)
          Will convert a decimal to a percentage.
static String formatPrice(double number)
           
static String getMD5(String input)
          Get the MD5 hash of a String
static String join(Collection<? extends Object> collection, String separator)
          Joins a collection of Objects separated by a specified separator
static Date parseDateString_MySQL(String dateString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

formatPrice

public static String formatPrice(double number)

join

public static String join(Collection<? extends Object> collection,
                          String separator)
Joins a collection of Objects separated by a specified separator

Parameters:
collection -
separator -
Returns:
the joined String

addWhiteSpaceToEnd

public static String addWhiteSpaceToEnd(String theString,
                                        int finalLength)
Adds whitespace to the end of given String

Parameters:
theString -
finalLength -
Returns:

formatPercentage

public static String formatPercentage(double number)
Will convert a decimal to a percentage. For example: .755 --> "75.5%"

Parameters:
number - the number in decimal form.
Returns:

formatDate_yyyyMMdd

public static String formatDate_yyyyMMdd(Date date)
Parameters:
date -
Returns:

formatDate_MySQL

public static String formatDate_MySQL(Date date)
Parameters:
date -
Returns:

parseDateString_MySQL

public static Date parseDateString_MySQL(String dateString)
Parameters:
dateString -
Returns:

getMD5

public static String getMD5(String input)
Get the MD5 hash of a String

Parameters:
input - the String to hash
Returns:
the hash of the given String


Copyright © 2013–2014 M. Alexander Nugent Consulting, Research and Devlopment. All rights reserved.