Answers for "how to check if a string contains a character a specific amount of times in java"

1

how to test how many of one character is in a string java

int count = string.length() - string.replaceAll("g","").length()
Posted by: Guest on June-02-2020

Code answers related to "how to check if a string contains a character a specific amount of times in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language