Ran your code. I think you need to add a space here:
With your code, when I passed the sub a string such as "this is a very long sentence without spaces in between", it gets transformed to "thisisaverylongsentencewithout" i.e. the original spaces were gone.$clipped .= $_; # orginal $clipped .= "$_ "; # changed
cheers
In reply to Re^2: In search of a better way to trim string length
by kiat
in thread In search of a better way to trim string
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |