roman13
(Roman)
December 8, 2022, 9:20am
1
How to convert a string with addition (2+2) in a text file, for example, into an int variable, so that the sum of this text file in the variable is calculated?
Gokul001
(Gokul Balaji)
December 8, 2022, 9:22am
2
HI @roman13
Welcome to uipath community
Check out the XAML file
Arithmeticoperation.xaml (5.7 KB)
Regards
Gokul
Yoichi
(Yoichi)
December 8, 2022, 9:24am
3
Hi,
Unfortunately there is no function like eval(). However there are some ways to acheive it as the following post. Can you check this?
Hi,
Unfortunately, Vb or C# doesn’t have a function like eval(), we need to approach by other ways.
● DataTable.Compute method
strExpression = "((10-5)*(2+2))*5"
dt = New DataTable()
Then
dt.Compute(strExpression, "").ToString
● Inject JS script activity
strExpression = "((10-5)*(2+2))*5"
Inject JS Script activity
Indicate an element in any browser.
Input Parameter : strExpression
ScriptCode
"function(e,v) {
return eval(v);
}"
ScriptOutput : strResult
●Use 3rd party library.
Per…
Regards,