Find index in string array
string[] CheckWB = { "SA1", "SA2", "SA3", "SA4","SA5","SA6" }; string value = this.txtWBCode.text; int InxWB = Array.IndexOf(CheckWB, value); if (InxWB > -1) { // return index array }