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
Post a Comment