Last Second string 1

How to take last second character in a line
I have many values with space split , I am not able to used (-2) also

Please help

Hey @Kuldeep_Pandey ,
lastSecondChar = line.Substring(line.Length - 2, 1)
Try this

Hi @Kuldeep_Pandey

Assuming you have a line of text stored in a variable called line

lastSecondCharacter As Char = line.Substring(line.Length - 2, 1)

Its giving me last digit no
like i have 12323 98656 acghfd -1787 8889
I want -1787

@Kuldeep_Pandey

inputStr.Split(" "c)(inputStr.Split(" "c).Length - 2)

Try with this

Hi @Kuldeep_Pandey

=> Assign -> StrVar = "12323 98656 acghfd -1787 8889"
=> Assign -> Output = StrVar.Split(" ")(3).Split(" ")(0)

Check the below workflow for better understanding

Hope it helps!!

1 Like

Hi @Kuldeep_Pandey

Input123.Split(" "c)(Input123.Split(" "c).Length - 2)

Thankyou all its working fine

2 Likes

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