I have the following items in my array:
var mystring;
var myname = "Level 1-1";
var myarray = [
"My Level 1-11 Ticket",
"My Level 1-1 Ticket",
"My Level 10-1 Ticket",
"My Level 10-11 Ticket"
];
for (var i = 0; i <= myarray.Count - 1; i++) {
if (myname == ) {
mystring = myarray[i];
break;
}
}
Now, I want to find out if there is an item in the array that contains the string "Level 1-1". But I only want to return the string that exactly contains "Level 1-1", I don't want to return similar strings like "Level 1-11".
The strings in myarray will only have values like: Level 1-1, Level 1-2, Level 1-10, Level 1-11, Level 10-1, Level 10-11.
The strings in myarray will never have values like: Level 1, Level 1-, Level -1, Level -1-1.
How can I only return the item of myarray that exactly contains "Level 1-1"?