var bestFirstValue = possibleValues .Where(x => currentLine.IndexOf(x.searchString) != -1) .OrderBy(x => currentLine.IndexOf(x.searchString)) .First() .intValue;