How to make this work, I cant call the string in a different method, please help

  • Thread starter Thread starter Salamandar
  • Start date Start date
S

Salamandar

Guest
static string[] x = {"Бургас","Варна","Силистра","Търговище","Ловеч",
"Кърджали","Пловдив","Благоевград","Пазарджик","Асеновград","Ботевград","Велико Търново","Габрово",
"Димитровград","Копривщица", "Крумовград", "Кърджали" };
static void Print(string[] a)
{
for (int i = 0; i < a.Length; i++)
{
string element = a;
Console.WriteLine(i+1+": "+a);
}
}
public static void SolveB(string[] a)
{

string part = "град";
bool show =x.Contains(part);
int firstCharacter = x.IndexOf(part);

Console.WriteLine("First occurrence: {0}", firstCharacter,part);


}

}
}

I want the string x to be recongnised by the indexOf so it can make the words which contains that part of the word but i cant make it work

Continue reading...
 
Back
Top