Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a: ',,,,,,,' match
- b: ',,,,,,#A' no match
- [^,]
- if (!Regex.IsMatch(yourTestString, "[^,]"))
- {
- // This string does NOT contain commas
- }
- var text = ",,,";
- Regex.IsMatch(text, @"^,+$"); // true
- private void IsOnlyOneChar(string input, char c)
- {
- for (var i = 0; i < input.Length; ++i)
- if (input[i] != c)
- return false;
- return true;
- }
- Regex.IsMatch(str, @"^,*$");
Add Comment
Please, Sign In to add comment