La funzione restituisce true se trova nella linea row la parola word.codice:bool isWordPresent(string code, int row, string word) { if (row<=0) throw new ArgumentException("row must be greater than 0.","row"); try { return code.Split(new char[]{'\n'},row)[row-1].IndexOf(word)!=-1; } catch(Exception) { return false; } }

Rispondi quotando