+ 1

String

first i Scan from console string word with spaces or characters and how do i find only letter's count. example.a is 5 b is 6or ? is 2

22nd Nov 2016, 5:23 PM
Hasim Hasimov
Hasim Hasimov - avatar
1 Answer
0
you can use loop like that : int count = 0; for (int i = 0 ; i < str.length() ; i++){ if(!str.charAt(i).equals(' ')) ++count; }
23rd Nov 2016, 1:35 AM
Mohammed Fakham
Mohammed Fakham - avatar