How do I make the following string cast:

```
"ln(5*x)" -> "Math.log(5*x)"
```

How do I make the following string cast:

```
"ln(5*x)" -> "Math.log(5*x)"
```

Ok, now, is there any gem or library to generalize the solution, transforming all the math-like strings into their Ruby expression representation (with all the Math affixes)?

gmile
2009-10-03 07:57:45
You'd better search on github.com

khelll
2009-10-03 07:58:30
They're just strings: treat them like strings. It's of no consequence that they look like math functions.

glenn jackman
2009-10-03 22:50:00