This is the string I have. Script:
Select * from tablename()
/*
go
*/
My code looks like this
private string RemoveBetween(s
private string RemoveBetween(String editScript, String begin, String end)
{
return Regex.Replace(editScript,
String.Format("{0}.*?{1}", begin, end),
String.Empty,
RegexOptions.Singleline)
}
usage:
editscript = RemoveBetween(editscript, "/", "/");
I've changed your signature to use String
, because you probably might want to call it like so (to remove SQL comment blocks):
editscript = RemoveBetween(editscript, "/\*", "\*/");