I have a need to search for numeric portions of strings in my data, do a simple calculation on them, and reinsert the result back into the string forming a new string. I can't seem to get my head around how I would do it.
Specifically, supposing I had a string that looked like this:
<$inData="action/4 request/3 dimension/2">
How would I, say, double the "request" identifier and so that the resulting string is:
"action/4 request/6 dimension/2"
I don't necessarily want to always double values, but I'm just saying this as an example. Once I figure out how to extract the specific numeric piece and reinsert it back into the string, I can handle all the various calcs I need to do.
Thanks in advance
Specifically, supposing I had a string that looked like this:
<$inData="action/4 request/3 dimension/2">
How would I, say, double the "request" identifier and so that the resulting string is:
"action/4 request/6 dimension/2"
I don't necessarily want to always double values, but I'm just saying this as an example. Once I figure out how to extract the specific numeric piece and reinsert it back into the string, I can handle all the various calcs I need to do.
Thanks in advance