Q

Modifying the text in the nth line using a .NET program

I have a text file and I have to modify the text in the nth line of the file using a .NET program. I tried to do this by reading line-by-line and writing it back to a new file using io.streamwriter, but it replaces characters like V?ommen to Vlkommen.
It looks like you are not accounting for internationalized characters. What you'll need to do is read up on the System.Globalization namespace and the CultureInfo class in particular. If the text file is ASCII based, you may want to strongly consider moving to UNICODE so you can handle any languages you need to handle.
This was last published in February 2004

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close