Sorry if the below doesn't show up. Code Project seems to have a bug. Something in the below code is preventing it from showing up when I click the "Preview" tab. Oh well, let's just hope is a preview problem and that this actually does show up once the answer is posted:
// This goes at the top of your file.
using System.Text.RegularExpressions;
// This code does what you want.
string pattern = @"(?<RESULT>\"".*?\"")";
string replace = "Function(${RESULT})";
string input = @"string file = ""this is a sample text"";";
string result = Regex.Replace(input, pattern, replace);
MessageBox.Show(result);