at.glawar
GlawarStrings [2006-06-10]

at.glawar.strings
Class StringUtil

java.lang.Object
  extended byat.glawar.strings.StringUtil

public class StringUtil
extends Object

This class provides methods that can be used nearly in every project.

Since:
10.02.2006
Version:
$Revision: 1.5 $ ($Date: 2006/06/01 18:28:38 $)
Author:
DI Franz-Peter Glawar last modified by: $Author: frahunz $, software.glawar.at

Method Summary
 boolean compareSimpleFormats(String strText1, String strText2)
          compares to strings whereas the strings will be internal transformed into strings without german special characters, only uppercase and only containing characters from the alphabet.
 boolean compareSimpleFormats(String strText1, String strText2, String strAllowedCharacters)
          compares to strings whereas the strings will be internal transformed into strings without german special characters, only uppercase and only containing characters from the allowed characters.
 boolean containsApostrophe(String strText)
          checks if a given text contains at least single or a double apostrophe.
 boolean containsBlanks(String strText)
          checks, if a given text contains at least one blank.
 boolean containsDoubleApostrophe(String strText)
          checks if a given text contains at least a double apostrophe.
 boolean containsSingleApostrophe(String strText)
          checks if a given text contains at least one single apostrophe.
static StringUtil getHandle()
           
 String makeThreeChars(int iValue)
          displays an integer value as a string with length 3.
 String makeTwoChars(int inputInt)
          Returns an integer-value as a string always with two digits, so if necessary with a leading 0.
 String makeTwoChars(String inputStr)
          Returns an integer-value as a string always with two digits, so if necessary with a leading 0.
 String replaceDoubleBackslash(String strInput)
          replaces all occurences of double backsplashes in a string by a normal slash.
 String replaceStr(String strOriginal, String strFind, String strReplacement)
          replaces strings in strings.
 String transformIntoSimpleFormat(String strText)
          transform the given text into a text that contains no german special characters, only uppercases and only the characters from the alphabet.
 String transformIntoSimpleFormat(String strText, String strAllowedCharacters)
          transform the given text into a text that contains no german special characters, only uppercases and only the characters described in the allowed characters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandle

public static StringUtil getHandle()
Returns:
static StringUtil
Since:
10.02.2006

replaceDoubleBackslash

public String replaceDoubleBackslash(String strInput)

replaces all occurences of double backsplashes in a string by a normal slash.

Parameters:
strInput - String-value containing the double backslashes
Returns:
strInput replaced with all double back slashes into normal slashes
Since:
10.02.2006

makeTwoChars

public String makeTwoChars(String inputStr)

Returns an integer-value as a string always with two digits, so if necessary with a leading 0.

Parameters:
inputStr - integer as a String
Returns:
integer as String with two digits
Since:
10.02.2006

makeTwoChars

public String makeTwoChars(int inputInt)

Returns an integer-value as a string always with two digits, so if necessary with a leading 0.

Parameters:
inputInt -
Returns:
integer as String with two digits
Since:
10.02.2006

makeThreeChars

public String makeThreeChars(int iValue)

displays an integer value as a string with length 3.

If necessary (integer value is only of length 1) leading 0 will be added.

Parameters:
iValue - the integer-value to display to
Returns:
the integer-value as a string of length 3
Since:
10.02.2006

containsBlanks

public boolean containsBlanks(String strText)

checks, if a given text contains at least one blank.

Parameters:
strText - text to check
Returns:
true if the text contains at least one blank
Since:
10.02.2006

containsApostrophe

public boolean containsApostrophe(String strText)

checks if a given text contains at least single or a double apostrophe.

Parameters:
strText - text to check
Returns:
true if the text contains at least either a single or a double apostrophe
Since:
10.02.2006

containsSingleApostrophe

public boolean containsSingleApostrophe(String strText)

checks if a given text contains at least one single apostrophe.

Parameters:
strText - text to check
Returns:
true if the text contains at least a single apostrophe
Since:
10.02.2006

containsDoubleApostrophe

public boolean containsDoubleApostrophe(String strText)

checks if a given text contains at least a double apostrophe.

Parameters:
strText - text to check
Returns:
true if the text contains at least a double apostrophe
Since:
10.02.2006

replaceStr

public String replaceStr(String strOriginal,
                         String strFind,
                         String strReplacement)

replaces strings in strings.

Parameters:
strOriginal - the string where the entry should be replaced with
strFind - the string that should be replaced
strReplacement - the string that should be replaced with
Returns:
the replaced string
Since:
10.02.2006

compareSimpleFormats

public boolean compareSimpleFormats(String strText1,
                                    String strText2)

compares to strings whereas the strings will be internal transformed into strings without german special characters, only uppercase and only containing characters from the alphabet.

Parameters:
strText1 - first string to compare to
strText2 - second string to compare to
Returns:
true if the two strings are equal about the conditions described above
Since:
10.02.2006

compareSimpleFormats

public boolean compareSimpleFormats(String strText1,
                                    String strText2,
                                    String strAllowedCharacters)

compares to strings whereas the strings will be internal transformed into strings without german special characters, only uppercase and only containing characters from the allowed characters.

Parameters:
strText1 - first string to compare to
strText2 - second string to compare to
strAllowedCharacters - the allowed characters
Returns:
true if the two strings are equal about the conditions described above
Since:
10.02.2006

transformIntoSimpleFormat

public String transformIntoSimpleFormat(String strText)

transform the given text into a text that contains no german special characters, only uppercases and only the characters from the alphabet.

Parameters:
strText - text to transform
Returns:
text without german special characters and only containing the letters from the alphabet
Since:
10.02.2006

transformIntoSimpleFormat

public String transformIntoSimpleFormat(String strText,
                                        String strAllowedCharacters)

transform the given text into a text that contains no german special characters, only uppercases and only the characters described in the allowed characters.

Parameters:
strText - text to transform
strAllowedCharacters - the allowed characters
Returns:
text without german special characters and only containing the characters from the strAllowedCharacters
Since:
10.02.2006

software.glawar.at

Developed by software.glawar.at