Simple Question
Just a simple question here...
In Perl, how would I isolate the first letter of a word to a variable??
Thanks!
--Edge
Just a simple question here...
In Perl, how would I isolate the first letter of a word to a variable??
Thanks!
--Edge
tmay posted this at 01:51 — 6th November 2001.
They have: 75 posts
Joined: Sep 2001
$first = substr($string, 0, 1);
Edge posted this at 22:49 — 6th November 2001.
They have: 117 posts
Joined: Mar 2000
Hey, Thanks! That works great. Could you tell me how to determine if that letter is a number?
tmay posted this at 02:03 — 7th November 2001.
They have: 75 posts
Joined: Sep 2001
$first = substr($string, 0, 1);
if($first =~ /[0-9]/)
{ ..do something if it's a number.. } else { ..do something else.. }
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.