in reply to Golf: Embedded In Order
Although, if $t may contain non-word characters, that becomes:sub t_in_s { ($t=pop)=~s/./$&.*/g;$_[0]=~$t } t_in_s('abcdefghijklmnopqrstuvwxyz', 'for');
sub t_in_s { ($t=pop)=~s/./\Q$&\E.*/g;$_[0]=~$t }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re (tilly) 2: Golf: Embedded In Order
by tilly (Archbishop) on Apr 27, 2001 at 18:41 UTC | |
by chipmunk (Parson) on Apr 30, 2001 at 09:01 UTC |