--- In [email protected], leds usop <[EMAIL PROTECTED]> wrote:
>
> Having no text doesnt mean the string value is "". An
> Empty string is different from a null or an undefined
> value. So i suggest throw in  a check for
> undefined/null value as well and if you dont turst
> that enough, check for the length as well.
> 
>  Moreover, when you say
> goodsInAdvice.text.indexOf("/") == 0 ; you are
> actually checking for the existence of the "/"
> character at the 0th index. If you want to check for
> it's absence, try goodsInAdvice.text.indexOf("/") ==
> -1 or goodsInAdvice.text.indexOf("/") < 0.
> 
> Based on the scenario you have 
> give, a null/undefined goodsInAccount.text and a
> goodsInAdvice.text with "/" in the beginning will
> really return true.
> 
> 
Thanks for the education. That helped me a lot. I have it working now.

cheers,  Graham


Reply via email to