Your current solution looks OK. You can have return m;
instead of return m++
.
If you want to shorten your code you can use Array.FindIndex<T>
like:
public static int LookUpLineNumber(String[] item, string TextToLookUp)
{
return Array.FindIndex<string>(item, r => r.Contains(TextToLookUp));
}
Not really sure if it would give you any performance gain.