I want to evaluate the content of a string variable as a operation.
My variable it’s this string:
1+1+0
I want to make the operation and get the value 2.
Thanks in advance,
Gustavo
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In XSLT 2.0 this can be done by using
tokenize(),number()andsum()functions, for example the below. Note that I included possible whitespaces surrounding the+signs.The result (with dummy input file) is