Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: need help regex ...Word Possibility ?
|
Posted: Sep 30, 2005 10:13 PM
|
|
Actually, on closer examination, I'm a little disappointed. Are you not a Java programmer? What's with String.toUpper()? Calling instance methods from a static method? What's String.contains()?
How about this solution:
class BankWords
{
int [] data = { 0x51, 0x75, 0x69, 0x74, 0x20, 0x62, 0x65, 0x69,
0x6e, 0x67, 0x20, 0x73, 0x6f, 0x20, 0x6c, 0x61,
0x7a, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64,
0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f,
0x77, 0x6e, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x77,
0x6f, 0x72, 0x6b, 0x2e };
private String decodeBankWords()
{
StringBuffer buffer = new StringBuffer();
for( int i = 0; i < data.length; i++ )
buffer.append( (char)data[i] );
return buffer.toString();
}
public static void main(String []args)
{
BankWords bankwords = new BankWords();
System.out.println(bankwords.decodeBankWords());
}
}
|
|