regex - How to check if a string contains only comma, in VB.NET -


i have string in vb.net can contain commas, or combination of letters, numbers , special characters.

for example, string can a,-,$,2 or ,,,

how can determine using regex if string has commas?

you want match string of commas?

i suggest check out regex class , @ using system.text.regularexpressions along regex.match method , regex.matches method

dim input string = ",,,,," dim m match = regex.match(input, "^,*$") if (m.success)     console.writeline("string has comma's") end if 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -