How to check the item as this format

to check given Number has numeric and character ‘-’ present in this format
example: 910-123456,

Is there is anyway to check,please help me out to solve this


Str = “820-123456”

Str.Contains(“-”) AND IsNumeric(Str)


You want to check whether the string has numbers and ‘-’ right?

Yes you can do that in two ways…

  1. Loop through all the characters and check whether each character is number or ‘-’


  1. String.contains is the predefined class to check it the specific character is present in it

@brindhaS You can use regex expression like below.

value = “820-123456”


  1. \d ↩︎

1 Like