I have a textView in which I can search some words and the code for the search is this:
public void btn_search(View view) {
int total = 0;
String word_search = Etxt.getText().toString().trim();
String fullTxt = textView.getText().toString();
String[] array = fullTxt.split("\n");
String word;
StringBuilder st = new StringBuilder();
for (int i = 0; i < array.length; i++) {
word = array[i];
if (word.contains(word_search)) {
st.append("<b><i>" + word.trim() + "</i></b>");
total++;
} else {
st.append(word);
}
st.append("<br>");
}
textView.setText(Html.fromHtml("" + st));
text_total.setText("Ergebnisse: " + total);
}
Now, the problem is that when I search something, I must pay attention to the higher lower case. And the question is: How can I make the higher lower case equal, so that I can search something without paying attention to this?
Thanks!