Answer the question
In order to leave comments, you need to log in
Why is the string not truncated?
private void button1_Click(object sender, EventArgs e)
{
txt.ShowDialog();
textBox1.Text = txt.FileName;
}
private void whereSave_Click(object sender, EventArgs e)
{
saveFileDialog1.ShowDialog();
whereSaveTxt.Text = saveFileDialog1.FileName;
}
private void button2_Click(object sender, EventArgs e)
{
string[] str = File.ReadAllLines(textBox1.Text);
foreach (string s in str)
{
s.Substring(0, s.Length -2);
File.WriteAllText(whereSaveTxt.Text, s);
Log.Text = "Сохранил " + s;
}
}
private void button3_Click(object sender, EventArgs e)
{
slice = Int32.Parse(textBox2.Text);
}
Answer the question
In order to leave comments, you need to log in
Why is the string not truncated?
s.Substring(0, s.Length -2);
And how can I make it so that the log is written from a new line
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question