TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
srikanth kamuju
NA
2
1.7k
Editing text in a file apostrophe is replaced with another
May 29 2013 8:40 AM
Dear All,
While editing the the text file the apostrophe (') is replacing with another character automatically. i dont want to be replaced it. See the below code for review.
StringBuilder newFile = new StringBuilder();
string temp = "";
string[] AllLines = File.ReadAllLines(FileName);
strStart = "<";
foreach (string strLine in AllLines)
{
if (strLine.Contains("CUsers") || strLine.Contains("_ags"))
{
fIndex = strLine.IndexOf(strStart);
sIndex = strLine.LastIndexOf("_ags");
temp = strLine.Remove(fIndex + 2, (sIndex - fIndex) + 2);
newFile.Append(temp + "\r\n");
continue;
}
newFile.Append(strLine + "\r\n");
}
File.WriteAllText(FileName, newFile.ToString());
Could any one please help me with code need urgent
Thanks in advance,
Srikanth
Reply
Answers (
2
)
C# web browser
How To Show logged in User name in caption??