trim
Posted: Mon Jun 14, 2004 1:54 pm
Lutz,
(trim currently works on both sides of a string. It would be nice if it could sometimes be restricted to the left side or right side of a string.
Example
(trim "00239800" "0" LEFT) => "239800"
or
(trim "00239800" "0" RIGHT) => "002398"
The LEFT and RIGHT constants are probably not the best way. It might be better having two
trim functions: (ltrim and (rtrim ?
Currently, I'm using (nth 3 (regex {0*(\d+)} w)) for the left trim.
Eddie.
(trim currently works on both sides of a string. It would be nice if it could sometimes be restricted to the left side or right side of a string.
Example
(trim "00239800" "0" LEFT) => "239800"
or
(trim "00239800" "0" RIGHT) => "002398"
The LEFT and RIGHT constants are probably not the best way. It might be better having two
trim functions: (ltrim and (rtrim ?
Currently, I'm using (nth 3 (regex {0*(\d+)} w)) for the left trim.
Eddie.