views:

43

answers:

1

Hi Friends,

My text file named test.txt contains

Fixing the type manager error during checkin of the elements and supporting issues during Checkin/Checkout & merge related problems.

Now i want to remove the text "supporting issues" using c#.

Please anybody let me know.

Thanks in advance, Naveenkumar.T

+2  A: 

Hi - if the file is fairly small you can do this:

using System.IO; // at the top of the file

string file = "path.txt"; // change to the path

// read the whole file into a string, make a replacement, then write all string to a file
File.WriteAllText(file, File.ReadAllText(file).Replace("supporting issues ",""));

Hope that helps.

Kieren Johnstone
Haha nice, that teaches us to read into questions too much. Good one!
Codesleuth
Where is "file" defined?
spender
Thank u Johnstone
naveenkumar