in reply to Re: Re: whitespace eliminator for arrays
in thread whitespace eliminator for arrays
You missed the little + I added to the regex. :-) Using for as expression modificator wasn't the point. The + will cause the regex to delete sequences of whitespace in one fell swoop, rather than character by character.
tr is better in that it doesn't fire up the entire regex engine to do its job. It's therefor more efficient for the specific job of deleting all of a list of characters from a string. However, it doesn't understand classes like \s as the regex engine does, so you have to spell out all the characters. Doing so with hex codes is merely one choice out of several.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^3: whitespace eliminator for arrays
by markcsmith (Novice) on Oct 22, 2002 at 22:25 UTC |