CopyToFile

public static class StringBuilderHelper
{
  public static void CopyToFile(this StringBuilder sBuilder, string path)
  {
    File.WriteAllText(path, sBuilder.ToString());
  }
}
Example:
new StringBuilder("Hello World!!!").CopyToFile(@"c:\helloworld.txt");

Description

Writes the specified StringBuilder to the file using the specified path. If the file already exists, it is overwritten.

Details

Double click on the code to select all.

 

;