Win a copy of Design for the Mind this week in the Design forum!
  • 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
Bartender
Posts: 2730
36
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic