if you want it in java.. I'll type it here (sorry, I don't have an eclipse on my PC so I can't copy-paste it from there)
Code:
public class Character
{
//if you need it to be an object - this is the building function
public Character ()
{
}
//if you don't need to create an object, you may want to type in a 'static' like this
//public static boolean compare(char[] a,char[] b,int slots), slots stands for a.length (or b.length, they're the same)
public boolean compare(char[] a,char[] b,int slots)
{
if(slots==0)
{
return true;
}
else if(a[slots-1]==b[slots-1])
return true&&compare(a,b,slots -1);
return false;
}
} that's just a recursive way I found which is not too hard to write and understand
hope it'll help you (: