To check in a string of size 8 that 7th position it is number or alphabet

To check in a string of size 8 that 7th position it is number or alphabet.

Thanks,
Shweta

Hi @shweta.uipath,

You can use isnumeric method already available in VB.net.

Dim IndexCount As Integer = 0
For Each character In YourString
      IndexCount = IndexCount  + 1
      If IndexCount = 7
        If IsNumeric(character) Then
            //Do whatever you want
        End If
      End If
Next

@shweta.uipath Check regex below regex method once.

System.Text.RegularExpressions.Regex.IsMatch(StringVariable.Substring(6,1),"[0-9]").ToString
1 Like

Thanks Manjuts90 and HareeshMR :+1: :slight_smile:

2 Likes