• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make case insensitive in android

 
deepika deepi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i want to make the coding case insensitive in android


i want to give an case insensitive statement in this line

if (listview_array[i].indexOf(et.getText().toString()) != -1)

where to give this case insensitive ? can any one help me ?
 
Tim Moores
Saloon Keeper
Posts: 3330
61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The String class has a method that returns a lowercase variant of the string. If you apply that to both strings in your comparison it should work fine.
 
deepika deepi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya got it. thank's
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!