Class
caplin.core

StringUtility

Utility class that provides methods for string manipulation.

Constructor Summary

Attributes Name and Description
caplin.core.StringUtility()

This is a static class that never needs to be instantiated.

Method Summary

Attributes Name and Description
<static> String buildString(Object oObject, String sSeparator, boolean bIncludeName)

Concatenates the string fields of an object into a single string, each field being separated from the next by 'sSeparator'.

<static> Boolean isNullUndefinedOrEmpty(String sString, Boolean bTrimWhitespace)

Determines if the string is null, undefined or an empty string.

<static> Array splitAndTrim(String sInput, String sSeparator)

Splits up the specified input string, based on the specified separator, and {@link #trim trims} each of the output strings.

Constructor Detail

caplin.core.StringUtility()

This is a static class that never needs to be instantiated.

Method Detail

<static> String buildString(Object oObject, String sSeparator, boolean bIncludeName)

Concatenates the string fields of an object into a single string, each field being separated from the next by 'sSeparator'. If bIncludeName is set to true, then the field name will also be included in the string.

Parameters
Object oObject The object whose fields will be concatenated into a single string.
String sSeparator The string to use as the separator between each field in the returned string.
boolean bIncludeName If true, the names of the object's fields will be included in the returned string.
Returns
A single string representing all the string fields of an object.

<static> Boolean isNullUndefinedOrEmpty(String sString, Boolean bTrimWhitespace)

Determines if the string is null, undefined or an empty string.

Parameters
String sString The string to be tested
Boolean bTrimWhitespace (Optional) Defaults to false. If true any whitespace will be trimmed before performing the empty string comparison.

<static> Array splitAndTrim(String sInput, String sSeparator)

Splits up the specified input string, based on the specified separator, and {@link #trim trims} each of the output strings. For example, the string "one, two, three" split with a comma separator will produce an array output of ["one","two","three"].

Parameters
String sInput The string to be split up.
String sSeparator The separator which will be used to split the string up.
Returns
An array containing the split string, with each of the contents of the array trimmed.