To split between words and add .. I'd use:$string =~ s/^(.{15}).+$/$1/;
This assumes you want a string 15 chars long + the "...", if there's not a space in the 15 chars it chops it there anyways.$string =~ s/^(.{1,15})\s*.*$/$1.../;
- p u n k k i d
"Reality is merely an illusion,
albeit a very persistent one."
-Albert Einstein
In reply to Re: Smart Substrings
by elusion
in thread Smart Substrings
by cei
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |