Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

com.arcle.rmt.j2se.util.StringUtilities Class Reference

Contains miscellanous string utilites. More...

List of all members.

Static Public Member Functions

String stripChars (String str, int startIndex, int endIndex, char[] chars, boolean exclude)
 Removes certain characters from a substring.

String stripAllExceptConsonantsOrFirstChar (String str)
 Removes all non-consonant characters except the first character.


Static Public Attributes

final char[] VOWELS
 Contains the vowels in the english language, both upper- and lower-case versions.

final char[] CONSONANTS
 Contains the consonants in the english language, both upper- and lower-case versions.


Private Member Functions

 StringUtilities ()


Detailed Description

Contains miscellanous string utilites.

Author:
Sasmito Adibowo
Version:
Id
StringUtilities.java,v 1.5 2003/05/15 19:43:56 adib Exp

Definition at line 64 of file StringUtilities.java.


Constructor & Destructor Documentation

com.arcle.rmt.j2se.util.StringUtilities.StringUtilities  )  [private]
 

Definition at line 65 of file StringUtilities.java.


Member Function Documentation

String com.arcle.rmt.j2se.util.StringUtilities.stripAllExceptConsonantsOrFirstChar String  str  )  [static]
 

Removes all non-consonant characters except the first character.

Parameters:
str the input string.
Returns:
the resulting string.

Definition at line 125 of file StringUtilities.java.

References com.arcle.rmt.j2se.util.StringUtilities.CONSONANTS, and com.arcle.rmt.j2se.util.StringUtilities.stripChars().

String com.arcle.rmt.j2se.util.StringUtilities.stripChars String  str,
int  startIndex,
int  endIndex,
char[]  chars,
boolean  exclude
[static]
 

Removes certain characters from a substring.

This method iterates through the characters in the specified substring, copying the desired characters into its output and ommitting all other characters.

Parameters:
str the source string.
startIndex The starting index of the characters to strip.
endIndex The index of the last character to strip.
chars The characters to remove from the string.
exclude When true, strip chars from str. When false, Strip other characters in str that does not exist in chars.
For example, when called with these parameters:

  • str = requirement
  • startIndex = 0
  • endIndex = 10
  • chars = aiueo

When exclude == true, the output is rqrmnt; when exclude == false, the output is euiee.

Returns:
the source string without the unwanted characters.
Note:
unlike Java's substring, all of the characters in the closed range startIndex through endIndex are included in the search scope.

Definition at line 97 of file StringUtilities.java.

Referenced by com.arcle.rmt.j2se.util.StringUtilities.stripAllExceptConsonantsOrFirstChar().


Member Data Documentation

final char [] com.arcle.rmt.j2se.util.StringUtilities.CONSONANTS [static]
 

Initial value:

 {
        'b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v',
        'w','x','y','z',
        'B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V',
        'W','X','Y','Z'
    }
Contains the consonants in the english language, both upper- and lower-case versions.

Definition at line 144 of file StringUtilities.java.

Referenced by com.arcle.rmt.j2se.util.StringUtilities.stripAllExceptConsonantsOrFirstChar().

final char [] com.arcle.rmt.j2se.util.StringUtilities.VOWELS [static]
 

Initial value:

 {
        'a', 'i', 'u', 'e', 'o',
        'A', 'I', 'U', 'E', 'O'
    }
Contains the vowels in the english language, both upper- and lower-case versions.

Definition at line 135 of file StringUtilities.java.


The documentation for this class was generated from the following file:
Generated on Fri Jun 18 19:55:00 2004 for Arcle Rambutan by doxygen 1.3.5