Заменить первый символ в списке - C#
Формулировка задачи:
private void button5_Click(object sender, EventArgs e)
{
List<string> ZmN = new List<string>();
string nmr1 = "*|";
if (radioButton1.Checked)
{
ZmN.Add(listBox2.Items.ToString());
foreach (var sm in ZmN)
{
for (int i = 0; i < ZmN.Count; i++)
{
sm.Substring(0, 0).Replace("*|","0");
listBox3.Items.Add(sm);
}
}
}
}Решение задачи: «Заменить первый символ в списке»
textual
Листинг программы
for (int i = 0; i < listBox1.Items.Count;i++)
{
try
{
listBox1.Items[i] = @"*|" + ((string)listBox1.Items[i]).Substring(1);
}
catch { }
}