Search Results

Search found 1 results on 1 pages for 'user3658127'.

Page 1/1 | 1 

  • Delete last line in txt file

    - by user3658127
    I wrote a foreach loop for my datagridview to write all rows to txt file. I have a problem as it adds 2 empty lines at the end, as 1 row is full of empty cells after adding/reading to datagrid view. Is there any way to omit the last line or delete it in txt? foreach (DataGridViewRow item in this.DB.Rows) { foreach (DataGridViewCell item2 in item.Cells) { if(item2.Value != null) filewrite.Write(item2.Value.ToString() + " "); } filewrite.WriteLine(""); }

    Read the article

1