I have to write the code to insert the space in middle of falt file.
I have text as below, each line column length should be same
123
123256
123323
the above string should looks like
123---
234256
987323
After 123 we need space. could you suggest how to do this.
I have loaded the file into string dr = file.ReadToEnd();
Use the string
splitfunction to split your lines at the line break (either\norSystem.Environment.NewLine, depending your desires). Iterate over the returned array toTrim()each string, then use thePadRightfunction to produce a new string of the desired length with the desired trailing characters. Then use one of the manyIOwrite functions to output to a new file or overwrite the existing file.