Created
December 19, 2019 22:11
-
-
Save ouzdev/5655336c7ddceb2765b58ce140e4c74d to your computer and use it in GitHub Desktop.
C# Contains metodunun kendi geliştirdiğim algoritma sayesindeki kullanılışı.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace manuel_contains_metodu | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
ArrayList metin_liste = new ArrayList(); | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
} | |
private void btn_ekle_Click(object sender, EventArgs e) | |
{ | |
string metin = txt_metin.Text; | |
metin_liste.Add(metin); | |
lst_metin.Items.Add(metin); | |
} | |
ArrayList liste_harf = new ArrayList(); | |
private void aranan_Metin_TextChanged(object sender, EventArgs e) | |
{ | |
lst_metin.Items.Clear(); | |
if (aranan_Metin.Text.Length == 0) | |
{ | |
foreach (string item in metin_liste) | |
{ | |
lst_metin.Items.Add(item); | |
} | |
} | |
else | |
} | |
for (int i = 0; i < metin_liste.Count; i++) | |
{ | |
string metin = metin_liste[i].ToString(); | |
string metin2 = ""; | |
for (int j = 0; j < metin.Length; j++) | |
{ | |
metin2 = metin2 + metin[j].ToString(); | |
if (metin2 == aranan_Metin.Text) | |
{ | |
lst_metin.Items.Add(metin_liste[i]); | |
} | |
if (metin2.Length == aranan_Metin.Text.Length) | |
{ | |
metin2 = metin2.Substring(1, metin2.Length - 1); | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment