Skip to content

Instantly share code, notes, and snippets.

@leifoolsen
Created April 20, 2015 13:26
Show Gist options
  • Save leifoolsen/34c27ae3a33048772396 to your computer and use it in GitHub Desktop.
Save leifoolsen/34c27ae3a33048772396 to your computer and use it in GitHub Desktop.
Check if a string contains only a given character using Guava CharMatcher
CharMatcher.is('0').matchesAllOf("0000000") => true
CharMatcher.is('0').matchesAllOf("0000001") => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment