Programımdaki arama fonksiyonu için bir öneri özelliğine sahip olmaya çalışıyorum, örneğin arama bölümünde janw doe yazdım ve HAYIR çıkacak çıktı - jane doe demek istedin mi? Sorunun ne olduğundan emin değilim, belki char/string karşılaştırması ile ilgili bir şey ... Ben char türünde char türünde her iki değişkenleri karşılaştırmayı denedim -> temp.Contains ... vb ama bir hata (char İçindekiler için bir tanım içermez). Bu konuda herhangi bir yardım isterim! 8)Char/String karşılaştırması
if (found == false)
{
Console.WriteLine("\n\nMATCH NOT FOUND");
int charMatch = 0, charCount = 0;
string[] checkArray = new string[26];
//construction site /////////////////////////////////////////////////////////////////////////////////////////////////////////////
for (int controlLoop = 0; controlLoop < contPeople.Length; controlLoop++)
{
foreach (char i in userContChange)
{
charCount = charCount + 1;
}
for (int i = 0; i < userContChange.Length;)
{
string temp = contPeople[controlLoop].name;
string check=Convert.ToString(userContChange[i]);
if (temp.Contains(check))
{
charMatch = charMatch + 1;
}
}
int half = charCount/2;
if (charMatch >= half)
{
checkArray[controlLoop] = contPeople[controlLoop].name;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////
Console.WriteLine("Did you mean: ");
for (int a = 0; a < checkArray.Length; a++)
{
Console.WriteLine(checkArray[a]);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
Sorunuz çok değil Açık, hangi kod ile sorun yaşıyorsunuz? – Alan