C# Reading a file and writing out replacing string

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-23T13:02:03Z Indexed on 2010/03/23 13:13 UTC
Read the original article Hit count: 132

Filed under:

What I have is a C# windows app that reads a bunch of SQL tables and creates a bunch of queries based on the results. What I'm having a small issue with is the final "," on my query

This is what I have

ColumnX,

from

I need to read the entire file, write out exactly what is in the file and just replace the last , before the from with nothing.

I tried .replace(@",\n\nfrom),(@"\n\nfrom) but it's not finding it. Any help is appreciated.

Example:

ColumnX,

from

Result:

ColumnX

from

© Stack Overflow or respective owner

Related posts about c#