Thursday, May 27, 2021

OIC - Javascript - find name and value parameters from a string

 function returnParameter(value,splitString,indexString,type,count){

var output=value.split(splitString)

var index=output[count].indexOf(indexString);

if(type=='Name'){

var parameter=output[count].substring(0,index);

}

else{

var parameter=output[count].substring(index+1);

}

result=parameter

return result

}

Input:

(abc;a=b,";","=","Name",$loopCountString)

(abc;a=b,";","=","Value",$loopCountString)

output:

Name=a

value=b

here loopCountOfString = the count of ";" the string contains.

No comments:

Post a Comment

Featured Post

OIC - how can I use XSLT functions to remove leading zeros from numeric and alphanumeric fields?

To remove leading zeros from an numeric field in Oracle Integration Cloud (OIC) using XSLT, you can Use number() Function The number() funct...