โ08-03-2022 01:28 AM
Hi all,
I am trying to get the value between the โ()โ of every record inside the array.
[
{ โbetroffene IT Systemeโ:[
โArdoqยท(431)โ
โSnapLogicยท(580)โ
]
}
]
So that I get an array:
[ {
โbetroffene IT Systemeโ:[
โ431โ
โ580โ
]
} ]
My expressions language is still a bit rustyโฆ
Solved! Go to Solution.
โ08-03-2022 02:37 AM
Hi,
You can use the below expression.
$[โbetroffene IT Systemeโ].map(x => x.substring(x.indexOf(โ(โ)+1, x.indexOf(โ)โ)))
โ08-03-2022 02:37 AM
Hi,
You can use the below expression.
$[โbetroffene IT Systemeโ].map(x => x.substring(x.indexOf(โ(โ)+1, x.indexOf(โ)โ)))
โ08-03-2022 05:08 PM
This also works and seems a little easier to understand. Instead of searching for the indexes of the open and close parenthesis and using a substring, it just removes everything that isnโt a numeric value. Great solution provided by nsingam, but in the spirit of offering you options, I thought I would share this one with you too. Definitely there are more than 1 way to skin a cat (horrible expression).
$[โbetroffene IT Systemeโ].map(x => x.replace(/[^0-9]/g, โโ))
โ08-03-2022 10:36 PM
Thank you for your answer, much appreciated. That I havenโt tought about that also. Because I always only need the numbers.
Regards
Jens