If else and indexOf

Hi there,
I have 2 dynamic textboxes and the first one creates some words randomly and I want the second one to tell me if the created words ends in “s” or “es” that it is “plural” else it is singular…
How do you achieve that ? thanks
here is all I can write:


if(_root.firstbox.text.indexOf("......")=s ||_root.firstbox.text.indexOf("......")=es)
{
_root.secondbox.text="it is plural"; 
}else{
_root.secondbox.text="it is singular"; 
}