String write/save in file

 public static bool Save(this string text, string pathWithTXTFullfilename)
        {
            try
            {
                //write string to file
                System.IO.File.WriteAllText(pathWithTXTFullfilename, text);
                return true;
            }
            catch (Exception)
            {
            }

            return false;
        }
Example:
String str = "Hi...I am go to save in file";
bool isSaved = str.Save("D:\myfile.txt");

Description

String save/write in file

Details

Double click on the code to select all.

 

;