how to make a if of a string[]
Hi im trying to make a if that test every line in search of a word, i made it in a way , that works, but have some delay, i want a no delay one , here is my code, sorry for my english.` if (SearchingForWord) { lines = content.Split('\n');
//Line Searcher
if (lines[currentLine].Contains(SearchWord.text))
{
string[] Words = lines[currentLine].Split('&');
if (Palabra.text.ToLower() == SearchWord.text.ToLower())
{
Palabra.text = Words[0];
Tipo.text = Words[1];
Conjugacion.text = Words[2];
Traduccion.text = Words[3];
Debug.Log("Palabra Encontrada");
SearchingForWord = false;
}
else if (Traduccion.text == SearchWord.text.ToLower())
{
Palabra.text = Words[0];
Tipo.text = Words[1];
Conjugacion.text = Words[2];
Traduccion.text = Words[3];
Debug.Log("Palabra Encontrada");
SearchingForWord = false;
}
else
{
currentLine += 1;
}
}
else
{
if (lines[currentLine] == "")
{
Debug.Log("no se encontro esta palabra en el diccionario");
SearchingForWord = false;
}
else
{
currentLine += 1;
}
}`
Comment