in reply to Checking for occurrence in comma separated string
$thestring = "15,130,213"; $thecheck = "13"; if ($thestring =~ /$thecheck/) { print "$thecheck is in $thestring"; } else { print "$thecheck is not in $thestring"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Checking for occurrence in comma separated string
by mulander (Monk) on Oct 25, 2005 at 11:25 UTC | |
|
Re^2: Checking for occurrence in comma separated string
by jdporter (Paladin) on Oct 25, 2005 at 12:37 UTC | |
by sauoq (Abbot) on Oct 25, 2005 at 14:13 UTC | |
by jdporter (Paladin) on Oct 25, 2005 at 15:26 UTC | |
by sauoq (Abbot) on Oct 25, 2005 at 16:04 UTC |