Skip to content

Tag: groovy

Evaluate groovy expression in java class

I am looking to evaluate math expressions from String values using groovy in java code. I have created groovy script like below: The class MyObject is defined as: The code to evaluate the expression is: I keep getting the below exception when I try to run the code: Please suggest the correct approach to achie…

Removing backslash and newline character within one column

I’m getting text string html along with backslash and newline character. I can easily remove html tags using .replaceAll(“<[^>]*>”,””) but still and new line character still exists. So, again i tried to replaceAll(“\r\n|\r|\n”,””) but removing en…