lamont Posted November 11, 2014 Share Posted November 11, 2014 aşagıdaki kodda textbox1 girilen isimleri diziye atama işlemi yaptım gider bir işlem olan silme işlemi textbox1 yazılan ismi diziden nasıl silebilirim araştırıdm ama bir çözüm bulamadım yardımcı olaiblirmisiniz Array.Clear(); çözümü bulamadım... namespace WindowsFormsApplication36 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } string[] dizi = { "" }; int i = 0,sayac=0; private void button1_Click(object sender, EventArgs e) { dizi[i] = textBox1.Text; listBox1.Items.Add(dizi[i].ToString()); label1.Text += "Eleman Listesi"+" "+ dizi[i].ToString()+"\n"; label2.Text="Elaman Sayısı"+" = "+sayac.ToString(); sayac++; } Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted November 11, 2014 Share Posted November 11, 2014 Sen niye List yapısını kullanmıyorsun ki... Bu arada kaç senedir yazılımcılık yaptım bu kadar spesifik dizi kullanmadm doğrusu. string[] array = new string[] { "1", "2", "3", "4", "5", "6", "7" }; List<string> list = new List<string>(array); //you can sort List<string>! list.Sort(); list.Remove("4");//remove specieifed item. list.RemoveAt(2);//remove item from index. list.RemoveRange(1, 2);//remove a range of items. Quote Link to comment Share on other sites More sharing options...
lamont Posted November 11, 2014 Author Share Posted November 11, 2014 simpon ben yeni başladım ama bir arkadaşım dizi array list gibi yapıalrın mantıgını tam ögrenmelisn diyor diger konuya daha geçmedim bunun mantıgını ögrenip mantık yürütme geliştirip diger konualra geçcegim 1 veya 2 hafta daha diziler üstünde duracagım iyice kavramam lazım Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.