This should work:
Ho can I trim a string so that all characters after a specific value are dropped. E.g I want to DROP the "~1.xls" from the following string. 0000715 RECORDATI PHARMACEUTICALS LTD 07 2010~1.xls. So I want the code to lookup "2010" in the string and delete all charaters after that.
tom_newton (22nd September 2010)
cheers mate I'll give it a go now and let you know how I get on.
Mercifully it's a few years since I had to type out some JS though, so can't give you the code directly.
Thanks All.. am not sure what the syntax should be. Please have a look at my code below. Its the variable "clpApprovedData" that I need to apply this trim on.
var actionName = eworkGetField("txtActionName");
var strorginal = eworkGetField("clpGeneratedData");
var strreturned = eworkGetField("clpApprovedData");
alert("strorginal=" + strorginal + "strreturned=" + strreturned);
I presume you mean strreturned? As that's a variable containing the string I presume eworkGetField returns.
Which is what webman suggested, inserted into your code.Code:var strreturned = eworkGetField("clpApprovedData"); strreturned = strreturned.substring(0, strreturned.lastIndexOf('~')); if(strorginal.toUpperCase()!= strreturned.toUpperCase())
thanks a million guys... it worked first time out again many many thanks and much appreciated
There are currently 1 users browsing this thread. (0 members and 1 guests)