How to get 3 last of index from split result?

Hi… i have string variable:
str = “ABCD|A1B2|C1C2|1234|4A3B”

i split this string with :
arr= str.Split("|"c)

result is {“ABCD”,“A1B2”,“C1C2”,“1234”,“4A3B”}

expect result is {“C1C2”,“1234”,“4A3B”}

Hi,

Can you try the following expression?

arrStr.Skip(arrStr.Length-3).Take(3).ToArray()

Regards,

Hey @Iwan_Kurniawan2,

You can do like this
strArray.Take(3).ToArray()

Thanks,
Sanjit

its work thankyou :star_struck:

1 Like

thankyou :star_struck:

a little bit fuzzy approach
grafik

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.