Link to home
Start Free TrialLog in
Avatar of Bonnie_K
Bonnie_K

asked on

Using C# open text file and add text to the beginning and end of each line

Hi,

I want to open a text file then add an open quotation mark to the beginning of each line and a quotation mark and a plus sign to the end of each line.

I am trying to do this in C# but cannot find any good examples.

Thanks for any help,
Bonnie
Avatar of Sh4d1
Sh4d1
Flag of Slovakia image

I suggest to read file in for/while read all lines into array and then with regular expressions add at the start and end of line what you want, then write changes back to file.
ASKER CERTIFIED SOLUTION
Avatar of raterus
raterus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bonnie_K
Bonnie_K

ASKER

Thank you very much, works perfectly!