Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Fast way to remove all non-numerical chars from a string

From: gregg::pointillistic::com at: 23-Sep-2007 11:17

>>> loop 1'000'000 [parse/all "(250) 764-0929"[some rule]]
Keep in mind that you're acting on the same string every time here. If all the numbers are formatted exactly the same, hardcoding the rules might be fastest, e.g. remove skip remove/part skip remove s 3 2 3 But only Kai can say how important the speed is. Processing a million inputs once may be no big deal, but if it has to happen in a loop, in under x amount of time, we may need to optimize much further. -- Gregg