More functionality of built in scripting functions

More functionality of built in scripting functions

The built-in string functions, like subString, indexOf, etc make scripting very easy - however, some of them are fairly limited in their functionality:

The indexOf function does not recognize a space as a valid argument, nor can you specify a "starting point" to start the search from.

Newlines seem to be replaced with a space in String form fields, which can make scripting difficult - though, this would require the indexOf function to also recognize the newline character/string as an argument. Indeed, it seems that the newline character ("\n") is not recognized anywhere, which makes scripting with multi-line string fields a bit difficult.

The subString function does not seem to be able to take 'complex' argument - e.g. I can't use
subString(previouslyFoundIndex + 4, anotherIndex - 2)
It is possible to get around this by created new variables, although this is a bit more cumbersome.

A function to convert Strings to numbers would be a good addition as well (similar to the java functions Integer.parseInt(String), Double.parseDouble(String), etc).