Regex Replace
I am having a problem in getting this regext statement to work. I exp3ect the Q: in the a.FullPath to be removed but it isn't happening. Any ideas why?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Roy S194 reputationPosted May 4, 2012, 11:20 AM EDT
So instead of
FullPath2 = Regex.Replace(a.FullPath, "Q:", "");
Try this:
FullPath2 = a.FullPath.Replace("Q:", "");
Lajapathy ArunRank #354 · 7K reputationPosted May 4, 2012, 11:22 AM EDT
using System;
using System.Text.RegularExpressions;
namespace RegexReplaceForum
{
public partial class regexClassMy : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string fullPath = @"Q:\1111_drop1.TXT";
string replaceStr=Regex.Replace(fullPath, "Q:", "");
}
}
}
replaceStr variable Output:\1111_drop1.TXT