Check the 5th position in the string is a digit 9 or not?

Hi all,

I am trying to do some string.manipulation bit failing with some silly mistake.
I want to check if my string contains a digit “9” on the 5th position only?
How can I use index of in a reverse way here,or is there any better way to do that?
Thanks in advance :slight_smile:

@Samiksha
Give a try on Char.IsDigit(youtstringvar(4))

1 Like

Thank you for your response,l.
One question,my entire string is a series of digits,
So I have to specifically check of the digit is 9?

Hi,
I think it is working with an extended code to your logic
Char.ToString(mystring(4)).Equals(“9”)

@Samiksha
maybe the requirement can be adopted. Your inital request was about to check if the the 5th character in the string is a digit.

With your feedback it sounds that you are interested on the check if the 5th position is a 9
Maybe following is more close to your needs:
grafik

3 Likes

Right,I think the question was not put up properly by me.Thank you for your response :slight_smile:

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