org.jasen.util
Class TextUtils

java.lang.Object
  extended byorg.jasen.util.TextUtils

public class TextUtils
extends Object

General text-related utility functions.

Author:
Jason Polites

Constructor Summary
TextUtils()
           
 
Method Summary
static int countChars(String str, char chr)
          Counts the number of given characters in the given string
static boolean matchKeyword(String[] keywords, String content)
          Matches a single keyword in a blob of text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtils

public TextUtils()
Method Detail

matchKeyword

public static boolean matchKeyword(String[] keywords,
                                   String content)
Matches a single keyword in a blob of text.

This is simply a convenience method and is used by the KeywordScanner

Parameters:
keywords -
content -
Returns:
True if the keyword was found in the content. False otherwise
See Also:
KeywordScanner

countChars

public static int countChars(String str,
                             char chr)
Counts the number of given characters in the given string

Parameters:
str -
chr -
Returns:
The number of occurrences of the given character in the given string