Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grátis+ 7
How to count occurrence of a given character in a String?
2 Respostas
+ 2
String s = "...";
int counter = 0;
for( int i=0; i<s.length(); i++ )
{
if( s.charAt(i) == '#x27; ) { counter++; }
}
0
مرحبا