Good Day Everyone
I have an Issue, hope you can help me .
I have a string tag in the Response, that string looks like this
What I need is to extract a substring for instance “UFO” from pipe to pipe , final result will be like UFO=pa , then save it into a variable
Also not all string will have UFO so Need to be able to consider that.
You can use split() to create an array
let string = "|Search=name|codProd=ABC_73335610|CNAD_ENTRY=1551|UFO=pa|UFD=sa|natOp=111";
var array = string.split('|');
You can target the element directly by its array index.
let search = array.find(element => element.includes("UFO"));
Both ways will return the “UFO=PA” string.
Good day mdjones , as always thank you very much ,for your help