Class StringBuilderExtensions
System.Text.StringBuilder extension methods.
Inheritance
System.Object
StringBuilderExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GlitchedPolygons.ExtensionMethods
Assembly: UnityScriptsLibrary.dll
Syntax
public static class StringBuilderExtensions
Methods
| Improve this Doc View SourceWriteToFile(StringBuilder, String)
Writes the System.Text.StringBuilder's characters out to a System.IO.FileStream, byte by byte (in a loop).
Slightly more efficient than System.IO.File.WriteAllText(System.String,System.String) and allocates less garbage.
Uses System.IO.FileMode.Create and System.IO.FileAccess.Write for the System.IO.FileStream.
Declaration
public static void WriteToFile(this StringBuilder stringBuilder, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Text.StringBuilder | stringBuilder | The System.Text.StringBuilder to write into a file on disk. |
| System.String | filePath | The destination file path. Make sure that the target directory exists before calling this! |