the following should work:
string strng = "dsksf#dfkfdsafl#dsfksa";
var s = strng.Substring(strng.IndexOf("#") + 1, strng.LastIndexOf("#") - strng.IndexOf("#") - 1);
var sw = new StreamWriter(@"C:\Users\clifford\Documents\text.txt");
sw.Write(s);
sw.Close();
Here I am assuming you want to store the string, not save the string, if you want to open a text file to get the string you can use the following:
var sr = new StreamReader(@"C:\Users\clifford\Documents\text.txt");
var x = sr.ReadToEnd();
sr.Close();
Be careful with your words, store would be to disk.