Vertices Engine  v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
Loading...
Searching...
No Matches
VerticesEngine.Diagnostics.StringBuilderExtensions Class Reference

Static class for string builder extension methods. More...

Static Public Member Functions

static void AppendNumber (this StringBuilder builder, int number)
 Convert integer to string and add to string builder.
 
static void AppendNumber (this StringBuilder builder, int number, AppendNumberOptions options)
 Convert integer to string and add to string builder.
 
static void AppendNumber (this StringBuilder builder, float number)
 Convert float to string and add to string builder.
 
static void AppendNumber (this StringBuilder builder, float number, AppendNumberOptions options)
 Convert float to string and add to string builder.
 
static void AppendNumber (this StringBuilder builder, float number, int decimalCount, AppendNumberOptions options)
 Convert float to string and add to string builder.
 

Detailed Description

Static class 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 occurred when you use StringBuilder.AppendFormat method. Another issue is memory allocation occurred 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);

Member Function Documentation

◆ AppendNumber() [1/3]

static void VerticesEngine.Diagnostics.StringBuilderExtensions.AppendNumber ( this StringBuilder builder,
float number )
static

Convert float to string and add to string builder.

It shows 2 decimal digits.

◆ AppendNumber() [2/3]

static void VerticesEngine.Diagnostics.StringBuilderExtensions.AppendNumber ( this StringBuilder builder,
float number,
AppendNumberOptions options )
static

Convert float to string and add to string builder.

It shows 2 decimal digits.

◆ AppendNumber() [3/3]

static void VerticesEngine.Diagnostics.StringBuilderExtensions.AppendNumber ( this StringBuilder builder,
int number,
AppendNumberOptions options )
static

Convert integer to string and add to string builder.

Parameters
number
optionsFormat options

The documentation for this class was generated from the following file: