since my original topic got spammed by someone who doesn't know how forums work here is a new one again:

string[] lines = { textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox6.Text, textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text};

i have this line to write to csv... but how can i add an item before textBox1.text? what makes the output by example:

name;<textBox1.text>

hope it is useful to you

string[] lines = { "a", "b","c"};
            string tmp = "pre_a";
            
            System.Collections.ArrayList arrls = new System.Collections.ArrayList();
            arrls.AddRange(lines);
            arrls.Insert(0, tmp);
     
            Object[] newLines = arrls.ToArray();

            foreach (string a in newLines) {

                listBox1.Items.Add(a);
            
            }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.