Parsing special strings within a text (eg. "%var%") ?
- by RadiantHex
Hi, I am supplying a Javascript function strings with commands (SVG path commands):
eg. "move 10 10 line 50 50"
move and line are commands
numbers are x, y coordinates
I would like to add special strings to these commands, that would instruct the function to use specific variables
eg. "move %mouseX%+1 %mouseY%+1"
where %mouseX% and %mouseY% would be the mouse x,y coordinates
How can I parse and replace these?