cynosurex.lang
Class StringManipulator

java.lang.Object
  extended by cynosurex.lang.StringManipulator
All Implemented Interfaces:
cynosurex.internal.AuthorCommon, cynosurex.internal.CommonInterface, cynosurex.internal.CompanyCommon

public class StringManipulator
extends java.lang.Object
implements cynosurex.internal.CommonInterface

This class contains methods that are missing in the java.lang.String class.


Field Summary
 
Fields inherited from interface cynosurex.internal.CommonInterface
copyright, copyrightYears, notice, program, version
 
Fields inherited from interface cynosurex.internal.AuthorCommon
author, copyrightSymbol, noticeMsg, rights
 
Fields inherited from interface cynosurex.internal.CompanyCommon
company, email, website
 
Constructor Summary
StringManipulator()
           
 
Method Summary
static int calculateNumberOfLines(java.lang.String text)
          This method calculates number of lines based on the number of new line character it encounters in the text.
static int countLineBreaksBeforePosition(java.lang.String text, int position)
          This method counts line breaks in the text string before the position specified.
static java.lang.String[] regExExtract(java.lang.String original, java.lang.String search)
          This method searchs for a returns a string that matches the regular expression.
static java.lang.String regExReplace(java.lang.String original, java.lang.String search, java.lang.String replace)
          This method searches and replaces a regular expression in the original string.
static java.lang.String replaceSubString(java.lang.String original, java.lang.String search, java.lang.String replace)
          This method searches for a sub-string in the original string.
static java.util.Vector stringToLinesVector(java.lang.String text)
          This method converts text into a vector of lines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringManipulator

public StringManipulator()
Method Detail

countLineBreaksBeforePosition

public static int countLineBreaksBeforePosition(java.lang.String text,
                                                int position)
This method counts line breaks in the text string before the position specified.


calculateNumberOfLines

public static int calculateNumberOfLines(java.lang.String text)
This method calculates number of lines based on the number of new line character it encounters in the text.


regExExtract

public static java.lang.String[] regExExtract(java.lang.String original,
                                              java.lang.String search)
This method searchs for a returns a string that matches the regular expression.

Parameters:
original - The original string to search.
search - The regular expression to search for.

regExReplace

public static java.lang.String regExReplace(java.lang.String original,
                                            java.lang.String search,
                                            java.lang.String replace)
This method searches and replaces a regular expression in the original string. When it finds the regular expression, it replaces it with the replacement string.

Parameters:
original - The original string to modify.
search - The regular expression to search for.
replace - The string to replace.
Returns:
The new string with all of the regular expression replaced with the replacement string.

replaceSubString

public static java.lang.String replaceSubString(java.lang.String original,
                                                java.lang.String search,
                                                java.lang.String replace)
This method searches for a sub-string in the original string. When it finds the sub-string, it replaces it with the replacement string.

Parameters:
original - The original string to modify.
search - The string to search for.
replace - The string to replace.
Returns:
The new string with all of the search string replaced with the replacement string.

stringToLinesVector

public static java.util.Vector stringToLinesVector(java.lang.String text)
This method converts text into a vector of lines.