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 first published in February 2004

Dig deeper on .NET Framework 3.0 design and architecture tools

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close