B
Brett
I've been trying different methods for replacing escaped strings. None
work. I even have a custom Replace() method but still can't get what I
need. Some of the characters I need to replace are:
\r\n with nothing
\" with only single quote.
myString = myString.Replace(@"\"", @""");
Replace(myString, @"\"", @""");
gives this error:
No overload for method 'Replace' takes '2' arguments
or
Replace(myString, @"\\""", @""""));
which doesn't work
//Replace function that I'm using
public static String Replace(String strText,String strFind,String
strReplace)
{
int iPos=strText.IndexOf(strFind);
String strReturn="";
while(iPos!=-1)
{
strReturn+=strText.Substring(0,iPos) + strReplace;
strText=strText.Substring(iPos+strFind.Length);
iPos=strText.IndexOf(strFind);
}
if(strText.Length>0)
strReturn+=strText;
return strReturn;
}
Any suggestions?
Thanks,
Brett
work. I even have a custom Replace() method but still can't get what I
need. Some of the characters I need to replace are:
\r\n with nothing
\" with only single quote.
myString = myString.Replace(@"\"", @""");
Replace(myString, @"\"", @""");
gives this error:
No overload for method 'Replace' takes '2' arguments
or
Replace(myString, @"\\""", @""""));
which doesn't work
//Replace function that I'm using
public static String Replace(String strText,String strFind,String
strReplace)
{
int iPos=strText.IndexOf(strFind);
String strReturn="";
while(iPos!=-1)
{
strReturn+=strText.Substring(0,iPos) + strReplace;
strText=strText.Substring(iPos+strFind.Length);
iPos=strText.IndexOf(strFind);
}
if(strText.Length>0)
strReturn+=strText;
return strReturn;
}
Any suggestions?
Thanks,
Brett