IndexOf SubString: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m 1 revision imported |
(No difference)
|
Revision as of 21:44, 25 May 2020
Example 1: I need from ‘Long_Long (personfield)’ everything before the first ‘\’.
So from this entry: SMTX\DDEVILDER I need: SMTX
I would normally do:
SUBSTRING('#REPLACE-PERSONFIELD-RequestedFor-Login_Long#', 0, INDEXOF('#REPLACE-PERSONFIELD-RequestedFor-Login_Long#', '\'))
Bit the ‘\’ needs to be excepted (don’t ask me why-), so you need it twice:
SUBSTRING('#REPLACE-PERSONFIELD-RequestedFor-Login_Long#', 0, INDEXOF('#REPLACE-PERSONFIELD-RequestedFor-Login_Long#', '\\'))
Example 2 : filename extraction
I need the filename of an uploaded file. It will give this normally:
<A HREF="http://dev.ssp7.smt-x.com/Forms/UserFiles/Uploads/Temp/stf2cbxcypkywtnrmcqt2cjq.8797.richardGere2.psd" target="_blank">richardGere2.psd</A>
So we need al input after the first '>' and before the next '<'
Method 1: Substring('#REPLACE-FORMFIELD-testfilenameextraction||Upload01||#',LastIndexOf('#REPLACE-FORMFIELD-testfilenameextraction||Upload01||#','">')+2,LastIndexOf('#REPLACE-FORMFIELD-testfilenameextraction||Upload01||#','<')-LastIndexOf('#REPLACE-FORMFIELD-testfilenameextraction||Upload01||#','">')-2)
sample form : http://dev.ssp7.smt-x.com/Forms/form.aspx?adminmode=1&id=428
Method 2:
GetXmlProperty('#REPLACE-FORMFIELD-UploadXmlTest||fuXml||#', '/A/@HREF')
sample form : http://dev.ssp7.smt-x.com/Forms/form.aspx?adminmode=1&id=502