Posted by Kimmo Laine on 11/28/05 15:53
"Brian" <not@given.com> wrote in message
news:wODif.4411$uR.2961@newsfe7-gui.ntli.net...
> Hi
>
> I should know this but never had to do it, I'm trying
> to work out what the beginning of a string contains
> What I'm trying to do is this
>
> $s = 'K123456'
>
> if the beginning of a string is 'K' then do X if
> beginning of a string is 'T' then do Y
> and so on
switch($s{0}){
case 'K':
// do something
break;
case 'T':
// do something else
break;
default:
// error handler
}
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid
Navigation:
[Reply to this message]
|