Case Sensitive matter in Java -
i have menu, "delete" option. delete list town user introduced earlier. , asking you, there code ignore if user introduce upper case or lower case?
for example, if list has 3 items: new york, bucharest, paris. if user try delete 1 of item list, if writes "new york", list of items stay same, because didn't use upper cases , program doesn't recognize item.
you use equalsignorecase() compare input menu item, method compare strings ignoring case sensitiveness.
if (input.equalsignorecase(menuitem)) { //do logic }
if menu item="new york" , input="new york", if condition true.
Comments
Post a Comment