- Home /
Insert string behind consecutive numbers in string?
I'm building a calculator using eval() and need exponents from "^".
I want to take
1+2^
and replace "^" with ","
and insert "Mathf.Pow(" behind "2".
I need it to work even when "2" has more than one digit.
It needs to become
1+Mathf.Pow(2,
Now, when user types "3", it becomes
1+Mathf.Pow(2,3
I already know how to add ")" when user types a non-number.
I will then eval() the expression and return the answer.
Thanks for the help! :)
Comment
Your answer

Follow this Question
Related Questions
turn string into function with arguments? 1 Answer
c# Eval()? 3 Answers
Is it possible to name a list by a string variable? 2 Answers
Creating a Token At function 0 Answers
Remove the last word from a string 2 Answers