package net.toodarkpark.util; import java.util.List; import java.util.Vector; import java.util.StringTokenizer; import java.io.*; /* * methods useful to strings */ public class StringUtils { public static List stringsFromStringWithDelimiter( String origString, String delim ) { StringTokenizer st = new StringTokenizer( origString, delim ); int numTokens=0; int i=0; List list = new Vector(); numTokens = st.countTokens(); for( i=0; i -1 ) { return true; } } else { if( str.toLowerCase().indexOf( myString.toLowerCase() ) > -1 ) { return true; } } } } return false; } public static boolean stringContainsAllStrings( String str, List strings, boolean ignoreCase ) { int i=0; int c=strings.size(); if( str == null ) { return false; } for( i=0; i -1 )) { return false; } } else { if( !(str.toLowerCase().indexOf( myString.toLowerCase() ) > -1 ) ) { return false; } } } } return true; } public static boolean stringIsEqualToAnyString( String str, List strings, boolean ignoreCase ) { int i=0; int c=strings.size(); for( i=0; i (length - 5)) { // shortest domain is 4 chars return false; } if(dot < at) { // there must be a . in the domain which follows the @ return false; } if(dot >= length - 2) { // the top level domain (the only thing after the last .) // must be two characters return false; } if(dot == at + 1) { // must have a domain name between the @ and the . return false; } } catch( Exception e ) { return false; } return true; } }