I need some help with something, if someone is willing to help a newbie.
I have this piece of String[] here
String [] localitate = new String[]{"abrud", "aiud", "alba iulia", "albac", "almasu mare", "arieseni", "avram iancu"};
and this piece of code here to capitalize the first letter (I'm creating an AutoCompleteTextView)
for(int i = 0 ; i < localitate.length; i++)
{
//localitate[i] = localitate[i].charAt(0).toUpperCase();
localitate[i] = localitate[i].substring(0, 1).toUpperCase() + localitate[i].substring(1).toLowerCase();
}
AutoCompleteTextView addressCity = (AutoCompleteTextView) findViewById(R.id.editText_objective_address_city);
ArrayAdapter<String> localitati = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, localitate);
Now, the thing is that, this code capitalizes only the first letter of the first word, but on the values with multiple words, does the same.
Can someone help me with this code so it can capitalize the first letter to all the words?