Re: test if nth sign of a string is a number



On 11/30/07, guba@xxxxxxxxxx <guba@xxxxxxxxxx> 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 digit with a pattern match. Is that what
you're looking for?

Cheers!

--Tom Phoenix
Stonehenge Perl Training
.



Relevant Pages

  • Cant Compiling perl5.8.8 on FreeBSD6.2
    ... WITH_DEBUGGING=yes Build perl with debugging support. ... First let's make sure your kit is complete. ... What is the file extension used for shared libraries? ... I'll use sprintf to convert floats into a string. ...
    (comp.unix.bsd.freebsd.misc)
  • RE: Optimization for faster select...
    ... Although its a cute idea to create a function based index on SUBSTR ... I tried to see whether the SUBSTR could be replaced with Perl formatting ... the possibility of writes delaying the extract. ... So, ladies and gets, everything comes down to using RowCacheSize attribute. ...
    (perl.dbi.users)
  • Re: use of DBI; I am getting multiple error messages mixed in with ?the correct output.
    ... But I'm not talking about C++ or Java or SQL. ... This is a perl newsgroup. ... to means by a "defined null string", as opposed to an undefined value. ... And where exactly are you getting the idea that the empty string is a ...
    (comp.lang.perl.misc)
  • Re: Perl Strings vs FileHandle
    ... Just wanted to run this through Perl gurus to see if fit is ... testing it every time through the loop. ... The comparison test to the string '1' is superfluous. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: How to get "perl -V"s output programmatically?
    ... JB> Sometimes I agree with her regexp-less solutions. ... Sadly I miss some of the Perl fun, ... especially not for contains literal string ... sure you can do many string things without regexes, ...
    (comp.lang.perl.misc)