Split string with space and obtain the second element from the last


#1

Hi. Can someone help me with this…?

I like to split string with space and obtain the second element from the last.

Example:

1 Moto E4 16 GB Black, No.1 EA 100.00
2 Apple iPhone 6 32 GB S EA 150.00
3 LG Stylo 16 GB DZ 1200.00

I like to obtain the second element from the last like:

EA
EA
DZ

Thanks!

Main.xaml (9.2 KB)


#2

@anna100 I’d go with strArray(strArray.Length-2) if it’s always the second element from the last.