String chop and chomp

I would like to see string.chop under utilities to quickly hack off the last character of a string. This is very handy in building custom queries.
eg.
"select field1, field2, "
chop chop
"from table1 as a, table2 as b, "
chop chop

:lol:

Chop Chop!!

I don’t think dev team will allow this function, because it’s a bit too “customised”.
Someone else might come up with .chopFront (omit first char) etc…

You can do this:
str = “Hello,”;
str = str.substring(0,str.length-1)

… and even create your own customised functions using global scripts.
formScript

globals.f_chop(myString);

globalScript(function), name is ‘f_chop’

var x = arguments[0]
return x.substring(0,x.length-1)

the formScript sends a string to the globalScript, which returns the altered string back.

This way you can create your own library of common tasks inside global scripts.
(BTW there’s already a feature request for having a custom code library on application level, making it accessable for all your solutions.)