


Hello
In some other scripts, we have the below syntax to ERASE all the left spaces or zeros & condenses finally, makes it a meaningful string with a good intendation,
SHIFT my_variable LEFT DELETING LEADING spaces/zeros,
do we have a EQUIVALENT code in JavaScript?
Thank you
Views
Replies
Sign in to like this content
Total Likes
Hi,
To remove leading space;
string.replace(/^\s+/, "");
To remove leading zero;
string.replace("/^0+/","");
It's same as general javascript.
Cheers!
Hi,
I designed a macro for Designer ES2 (9.x) and ADEP Designer (10.x).
It looks for JavaScripts in a form template and beautifies them, means the script are formatted in that way a JavaScript should look like.
This also removes all unneccassary leading and trailing spaces.
http://thelivecycle.blogspot.com/2011/08/javascript-beautifier.html