org.esau.ptarmigan.util
Class HelperMisc
java.lang.Object
|
+--org.esau.ptarmigan.util.HelperMisc
- public final class HelperMisc
- extends java.lang.Object
Some static methods of general use
- Version:
- $Revision: 1.3 $ $Date: 2002/09/19 03:35:45 $
- Author:
- Reed Esau
Method Summary |
static java.lang.String |
clean(java.lang.String str)
Removes all chars that do not fit into the categories (isLetterOrDigit,
isWhitespace, printable ASCII); does not trim(). |
static java.lang.String |
cleanAlpha(java.lang.String str)
Removes all non-alpha chars |
static int |
parseInt(java.lang.String str,
int default_val)
a safe integer parser |
static boolean |
startsWith(byte[] haystack,
int haystack_offset,
int haystack_count,
byte[] needle)
is the needle the first thing in the haystack? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HelperMisc
public HelperMisc()
parseInt
public static int parseInt(java.lang.String str,
int default_val)
- a safe integer parser
startsWith
public static boolean startsWith(byte[] haystack,
int haystack_offset,
int haystack_count,
byte[] needle)
- is the needle the first thing in the haystack?
cleanAlpha
public static java.lang.String cleanAlpha(java.lang.String str)
- Removes all non-alpha chars
- Returns:
- "" if all characters stripped.
clean
public static java.lang.String clean(java.lang.String str)
- Removes all chars that do not fit into the categories (isLetterOrDigit,
isWhitespace, printable ASCII); does not trim().
TODO: figure out some way to include non-ASCII punctuation characters.
- Returns:
- "" if all characters stripped.
Copyright © 2002 Reed Esau, All Rights Reserved.