I have alphanumeric strings like S00125701. How do I find numbers in between?
Case H00125701 To H00125859
Label1.Text = "Box # 110"
I have alphanumeric strings like S00125701. How do I find numbers in between?
Case H00125701 To H00125859
Label1.Text = "Box # 110"
You can Select Case directly on the string:
Select Case string
Case "H00125701" To "H00125859"
Label1.Text = "Box # 110"
End Select
If your problem is that your input string starts with S but you have to test against strings which begin with H then a Replace will work:
Select Case string.Replace("S", "H")
Case "H00125701" To "H00125859"
Label1.Text = "Box # 110"
End Select
If your problem is that your input string could start with any letter but you have to test against strings which begin with H (or any other letter for that matter) and there will only ever be a single letter then a Substring and Convert will work:
Select Case Convert.ToInt32(string.Substring(1))
Case 125701 To 125859
Label1.Text = "Box # 110"
End Select