comparing part of a string regardless the other part

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Norgy
    New Member
    • May 2013
    • 56

    comparing part of a string regardless the other part

    how can i compare part of a string with another string regardless the rest of the string?
    for example: if i want to find whether a string has an underscore or not
    Code:
    if(x[i].equals("anything_anything"))
    i want this if condition to return true
    how can i do that ?
  • Norgy
    New Member
    • May 2013
    • 56

    #2
    i found a function called "contains" that do what i need
    Code:
    if(x[i].contains("_"))
    thanks :)

    Comment

    Working...