Hi
If your meaning of question is "You write function from your code for example function.cs and know you want read this file(function.cs) and store in string variable Ok you can do it however I don`t know why you want to do ?
1- you should used
System.Reflection
and
System.IO
1-1- Read your file function.cs with
System.IO.StreamReader
System.IO.StreamReader sr = new System.IO.StreamReader("File Path");
string function = sr.ReadLine();
However pay attention to maybe you need to the pars function and remove namespace and other not necessary strings.
2- After that you can use
System.Reflection
to create instance of your function.cs and for know how do that you can search from google ;-)
Best Regards.