get integer from text?
I just want to create the string "text.2" by splitting "text.1" into "text" and "1" (I found a tokenizer to do that) and then increment the 1. Problem is converting "1" into an integer value.
I've looked all through the docs, and am not finding it. Thanks for any tip.
-e
The [regexp] object is good for this sort of task.
thanks!
I would not have thought of that.... I need to study regex a bit!
regex take more than a bit of study. Every time I try to use it, I go back to studying it.
(btw: I'm cbm as well as Chris Muir. For some reason I ended up with two accounts.)
"regex take more than a bit of study. Every time I try to use it, I go back to studying it."
that's exactly what it looks like, the only of max' more complex modules i never used. doing that sort of with [atoi] and [zl], looks ugly but at least i understand what it is doing (the patch is slightely fattened up by the option of having numbers greater than 9) ;)
...exactly, it's utterly and completely logical, yet looks completely illogical and seems impossible to decipher...
maybe not so much to decipher but to memorize in detail.
Well, I found a much more comprehensible way to do it using fromSymbol--that's the max module I was looking for.... I use my string tokenizer into zl ecils, and the second out goes to fromSymbol. Works great, and doesn't mind spaces prior to the number.
But I still feel I should figure out regex. It's a crazy powerful tool....
....but maybe not today ;)
A good place to learn about regex is http://www.regular-expressions.info/tutorial.html
There are also many good tools to help create and test regular expressions.
ah ok thanks.