On 1 Dez., 04:20, [EMAIL PROTECTED] (Jeff Pang) wrote:
> On Nov 30, 2007 10:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > how can I test if the nth (n=2) sign of a string is a number [0-9]?
> > Thank you.
>
> Hello,
>
> Given you have this string: $str = "a9d0";
>
> you can
"Jeff Pang" schreef:
> guba:
>> how can I test if the nth (n=2) sign of a string is a number [0-9]?
>
> Given you have this string: $str = "a9d0";
> you can check if the 2nd character is a number or not by:
> my $c = substr($str,1,1);
> print ($c=~/[0-9]/) ? "a number" : "not a number";
On Nov 30, 2007 10:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> how can I test if the nth (n=2) sign of a string is a number [0-9]?
> Thank you.
>
Hello,
Given you have this string: $str = "a9d0";
you can check if the 2nd character is a number or not by:
my $c = substr($str,
On 11/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> how can I test if the nth (n=2) sign of a string is a number [0-9]?
It sounds as if you want to examine a particular character indexed in
a string; in Perl that's generally done with the substr() function.
You can check whether it's a di
Hello,
how can I test if the nth (n=2) sign of a string is a number [0-9]?
Thank you.
Guenter
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/