in reply to delete space
Split on [ ,]+ so that split eats the spaces as well as the commas. The grep eliminates the first empty ("") element.$ perl -we ' print "--$_--\n" for grep $_, split /[ ,]+/, " c1, c2, s1, s2, c3 "; ' --c1-- --c2-- --s1-- --s2-- --c3--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: delete space
by ikegami (Patriarch) on Nov 30, 2009 at 15:57 UTC | |
|
Re^2: delete space
by zeni (Beadle) on Dec 01, 2009 at 07:52 UTC |