And if you want to check it's at the begining of a string just check the return value e.gmy $value = '$100'; if( index($value, '$') > -1) { print 'found "$" in $value'; } else { print 'no "$" in $value'; } __output__ found "$" in $value
See. index for more info.my $value = '$100'; if( index($value, '$') == 0) { print 'found "$" at beginning of $value'; } else { print 'no "$" in $value'; } __output___ found "$" at beginning of $value
_________
broquaint
In reply to Re: if contains
by broquaint
in thread if contains
by nasa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |