Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: find the starting character position in a line

by linuxer (Deacon)
on Apr 16, 2009 at 08:47 UTC ( #757897=note: print w/ replies, xml ) Need Help??


in reply to find the starting character position in a line

$ perl -wle ' $line = " This is a test."; if ( $line =~ m/(\S)/g ) { print pos($line); } ' 4


Comment on Re: find the starting character position in a line
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://757897]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2014-08-31 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls