c# - Search string from array and reference array number -
I'm new to C #, and I do a string search to see if it's a string Members are trying to include array. Some of the string arrays are included, so I record the index number of the array members found it, and then want to display it.
string stringToBeSearched = "I want to apply ITEM2 or item6"; String [] array = {"item 1", "item 2", "item 3"}; // Find anything in the array stringToBeSearched, then the number of integer position integer position = // array index item found in the Console.WriteLine // Enter the value of the member value ("{0} was found.", Array [position]) ; Console.ReadLine (); You can compare an array element with the itemprop = "text"> stringToBeSearched
after
Comments
Post a Comment