• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

Can someone email this to me?

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
I'm a school and have no access to a method to get this code home. Can someone please copy/paste this to eyemwing@earthlink.net ?

//Tony Bathgate
//11/06/03
//palindrome.java
//Determines if a given string is a palindrome.

public class palindrome
{

public static void main(String[] args)
{
palindrome palindrome=new palindrome();
palindrome.pal("h.,!;h n jhdj!,.; ");
}

public static void pal(String strA)
{
int len,loop;
String strB=new String();
char ch1;

strA=strA.toLowerCase();
len=strA.length();
loop=0;
while(loop<=(len-1))
{
ch1=strA.charAt(loop);
if (ch1==' ' || ch1=='.' || ch1==',' || ch1=='!' || ch1==';' || ch1==':' || ch1=='?')
{
loop++;
}
else
{
strB=strB+ch1;
loop++;
}

}


}
}
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
Where's the Evil Mod? We need him to mess with EyeMWing's code a little :)
 

AdamSnow

Diamond Member
Nov 21, 2002
5,736
0
76
Sure the other way is easy, but I did it just cause I'm bored at work...

:beer:
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: Argo
Where's the Evil Mod? We need to him to mess with EyeMWing's code a little :)

Heh. A mod that knows java. That's the definition of evil.