I have edittext, and I want to count the words in it. Something is wrong when there are new lines in the editor.
I tried this:
String[] WC = et_note.getText().toString().split(" ");
Log.i("wordcount", "wc: " + WC.length);
This is text → wc: 4
it
and
text → wc: 4
it
plain
text → wc: 4
Any ideas?
source
share