[dba-VB] C# replace a special character

Charlotte Foust cfoust at infostatsystems.com
Tue Oct 20 11:34:42 CDT 2009


Except the for the semicolon, that's the way to do it in VB.Net too.

Charlotte Foust 

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, October 20, 2009 9:22 AM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] C# replace a special character

Hi John

You should be able to use the Replace method directly on your string
holding the line or the file:

  theStringToCleanUp.Replace(((char)26).ToString(),"");

like:

  string contents = File.ReadAllText(path);
  File.WriteAllText(path, contents.Replace(((char)26).ToString(),""));

/gustav





More information about the dba-VB mailing list