Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [kzap] global to cut short variable

Quote Reply
Re: [kzap] global to cut short variable In reply to
Something like this I think. If it ends in a space it should just cut off the space but if it is a space and then letters it will assume this is an incomplete word and cut this off as well.

sub {
my $field = shift;
my $length=shift;
my $short = substr($field, 0, $length) ; $short =~ s/\s\S*$//; $short .= '...';

return $short;

}
Subject Author Views Date
Thread global to cut short variable kzap 2880 Sep 9, 2003, 11:21 AM
Thread Re: [kzap] global to cut short variable
afinlr 2827 Sep 9, 2003, 4:23 PM
Thread Re: [afinlr] global to cut short variable
kzap 2833 Sep 9, 2003, 9:33 PM
Thread Re: [kzap] global to cut short variable
Andy 2834 Sep 10, 2003, 12:39 AM
Thread Re: [Andy] global to cut short variable
kzap 2811 Sep 11, 2003, 11:18 AM
Post Re: [kzap] global to cut short variable
Andy 2816 Sep 11, 2003, 11:22 AM
Post Re: [kzap] global to cut short variable
afinlr 2801 Sep 11, 2003, 3:23 PM