# Convert a String with a Math expression in Number result

**URL:** <https://forum.kirupa.com/t/convert-a-string-with-a-math-expression-in-number-result/229991>\
**Category:** Uncategorized\
**Created:** [June 21, 2007, 9:05pm UTC](https://forum.kirupa.com/t/convert-a-string-with-a-math-expression-in-number-result/229991 "2007-06-21T21:05:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mezzalab](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@mezzalab](https://forum.kirupa.com/u/mezzalab)\
**Post date:** [June 21, 2007, 9:05pm UTC](https://forum.kirupa.com/t/convert-a-string-with-a-math-expression-in-number-result/229991/1 "2007-06-21T21:05:39Z")

</div>

Hi All,

I’ve this XML:

```auto
<myXml>

   <item>{0}+{1}-{2}</item>

</myXml>

```

I use bracket because with StringUtil class I can change values with some variables define by user.  
So I must take the numeric result of my expression in XML, this is a simple example but I’ll have tang, sin and cos in XML nodevalue also…  
I tried with casting or parseInt but nothig… any other idea?
