Thread: My task

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Location
    Kiev, Ukrain
    Posts
    89
    Rep Power
    2

    My task


    Hi. I need to check every letter in string array. I'm doing that like this :
    for(int i= 0; i< str.length; i++){
    for(int j= 0; j<str[i].length(); j++){
    while(!ba){
    if(str[i][j] == "-"){ // here

    }
    }
    }
    }
    but there is an error
    The type of the expression must be an array type but it resolved to String
    i can't understand why i can compare string to string. how can i do that ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Location
    Kiev, Ukrain
    Posts
    89
    Rep Power
    2
    I found my mistake.
    condition should be like that : if(str[i].charAt(j) == '-')

IMN logo majestic logo threadwatch logo seochat tools logo