|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re^2: In search of a better way to trim string lengthby kiat (Vicar) |
| on Jul 19, 2004 at 08:57 UTC ( #375497=note: print w/ replies, xml ) | Need Help?? |
|
Thanks, BrowserUk! Very cool code but harder to understand for me...I ran it and got the results as expected, with a tiny 'bug'. When I passed it the string "this is a very long sentence without spaces in between", the shortened string was "this is a very long ..." (no problem there). When I passed it the string "thisisaverylongsentencewithoutspacesinbetween", the output was "thisisaverylongsentencewith..." i.e. without any space between the last character of that string and '...'. Nothing serious really but just thought I would bring it up.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||