in reply to if contains
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
|
|---|