O
O
Octavia Melody2015-10-27 13:11:31
Android
Octavia Melody, 2015-10-27 13:11:31

How to implement non-space character count in EditText?

Hello dear friend!
I have a rather unusual question.
I have a ready code for counting characters in EditText ( download ), but the thing is that it counts the number of characters with spaces.
Is it possible to somehow implement the ability to count the number of characters without spaces? Thanks a lot!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2015-10-27
@OctaviaMelody

st.replaceAll("\\s","") - apply this function to the string after you extract the text from the EditText and it removes all spaces, then apply your code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question