How to convert a string to character by character in Android?
<p>I have Edittext field that the user can enter their name. I want to check it with alphabets for how many times a letter comes.
Which is the best way to do this?</p>

<p>I tried the below code for getting each character from the string but error occurring? I appreciate it if any one can help.</p>

<pre><code>name=(EditText)findViewById(gami.Numerology.R.id.inputUI);
String a=name.getText().toString();

for ( int i = 0; i &lt; a.length(); i++ )

{  
           c = a.charAt(i);

            if (c=='s')
            {
            s=1; //like this for all characters
            }

         }
</code></pre>

<p>I just put this in a click event of button.</p>
