ExtensionMethod.NET Home of 876 C#, Visual Basic, F# and Javascript extension methods


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


public static class StringBuilderHelper
  public static void CopyToFile(this StringBuilder sBuilder, string path)
    File.WriteAllText(path, sBuilder.ToString());


new StringBuilder("Hello World!!!").CopyToFile(@"c:\helloworld.txt");

Author: Érico Luis Barrientos Leite

Submitted on: 5 feb. 2012

Language: C#

Type: System.Text.StringBuilder

Views: 5145