C# Class TimeRulerLibrary.StringBuilderExtensions

Static flass for string builder extension methods.
You can specified StringBuilder for SpriteFont.DrawString from XNA GS 3.0. And you can save unwanted memory allocations. But there are still problems for adding numerical value to StringBuilder. One of them is boxing ocurred when you use StringBuilder.AppendFormat method. Another issue is memory allocation occured when you specify int or float for StringBuild.Append method. This class provides solution for those issue. All methods are defined as extension methods as StringBuilder. So, you can use those method like below. stringBuilder.AppendNumber(12345);
Datei anzeigen Open project: jaquadro/MonoGdx

Public Methods

Method Description
AppendNumber ( this builder, float number ) : void

Convert float to string and added to string builder.

It shows 2 decimal digits.

AppendNumber ( this builder, float number, AppendNumberOptions options ) : void

Convert float to string and added to string builder.

It shows 2 decimal digits.

AppendNumber ( this builder, float number, int decimalCount, AppendNumberOptions options ) : void

Convert float to string and added to string builder.

AppendNumber ( this builder, int number ) : void

Convert integer to string and added to string builder.

AppendNumber ( this builder, int number, AppendNumberOptions options ) : void

Convert integer to string and added to string builder.

Private Methods

Method Description
AppendNumbernternal ( StringBuilder builder, int number, int decimalCount, AppendNumberOptions options ) : void

Method Details

AppendNumber() public static method

Convert float to string and added to string builder.
It shows 2 decimal digits.
public static AppendNumber ( this builder, float number ) : void
builder this
number float
return void

AppendNumber() public static method

Convert float to string and added to string builder.
It shows 2 decimal digits.
public static AppendNumber ( this builder, float number, AppendNumberOptions options ) : void
builder this
number float
options AppendNumberOptions
return void

AppendNumber() public static method

Convert float to string and added to string builder.
public static AppendNumber ( this builder, float number, int decimalCount, AppendNumberOptions options ) : void
builder this
number float
decimalCount int
options AppendNumberOptions
return void

AppendNumber() public static method

Convert integer to string and added to string builder.
public static AppendNumber ( this builder, int number ) : void
builder this
number int
return void

AppendNumber() public static method

Convert integer to string and added to string builder.
public static AppendNumber ( this builder, int number, AppendNumberOptions options ) : void
builder this
number int
options AppendNumberOptions Format options
return void