Perl: the Markov chain saw | |
PerlMonks |
Re: Re: Re: Counting number of characters in a stringby t0mas (Priest) |
on Mar 13, 2001 at 14:22 UTC ( [id://64101]=note: print w/replies, xml ) | Need Help?? |
$_="YASWOCCIAS"; don't contain any newlines so it doesn't matter in this case. In other cases it might, depending on how you define "character" in your application. For some apps (like word processors), s/\S/+1/g; might be the right choise if you like to use this algorithm in your production environment... :-)
/brother t0mas
In Section
Seekers of Perl Wisdom
|
|