Remove the last three elements from array of string


#1

Hi.

I have arrays of strings such as:

Lenovo Flex 5 Laptop, 15.6in. EA 90.0001 I
Microsoft, Surface Pro, 12.3" DZ 10.0000 II
Apple, iPad mini 4 128GB EA 12.3456 III

Is there any way to remove the last three elements (e.g. “EA”, “90.0001” and “I”) from the original array?

I like to extract the only elements I need such as:

Lenovo Flex 5 Laptop, 15.6in.
Microsoft, Surface Pro, 12.3"
Apple, iPad mini 4 128GB

Thanks :slight_smile:

Remove the last three elements.xaml (9.4 KB)


#2

Hi @anna100

The regex could look like that:
.+(?= [A-Z]{2} )
It assumes that the EA, DZ, etc will always be two capital letter (and nothing else)

See attachment for your xaml file:
Remove the last three elements.xaml (9.2 KB)


#3

It worked! Thanks! I also appreciate your explanation :grinning:


#4