Here is the search I have so far:
Code:
int index = 0;
boolean found = false;
while(index < tracks.size() && !found){
String track = tracks.get(index);
if(track.contains(searchString)){
found = true;
}
else{
index++;
}
}
|
Newbie Member
|
|
| 16Nov2008,04:17 | #1 |
|
I'm having trouble returning an index number based on a String search. I have a class called CD with a field of tracks. I am trying to search for the track number based on the String I provide.
Here is the search I have so far: Code:
int index = 0;
boolean found = false;
while(index < tracks.size() && !found){
String track = tracks.get(index);
if(track.contains(searchString)){
found = true;
}
else{
index++;
}
}
|