# If else and indexOf

**URL:** <https://forum.kirupa.com/t/if-else-and-indexof/278555>\
**Category:** Uncategorized\
**Created:** [January 1, 2009, 8:13pm UTC](https://forum.kirupa.com/t/if-else-and-indexof/278555 "2009-01-01T20:13:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gencoglu](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gencoglu](https://forum.kirupa.com/u/gencoglu)\
**Post date:** [January 1, 2009, 8:13pm UTC](https://forum.kirupa.com/t/if-else-and-indexof/278555/1 "2009-01-01T20:13:52Z")

</div>

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:

```php

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

```
