Vertices Engine
v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
|
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. | |
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);
|
static |
Convert float to string and add to string builder.
It shows 2 decimal digits.
|
static |
Convert float to string and add to string builder.
It shows 2 decimal digits.
|
static |
Convert integer to string and add to string builder.
number | |
options | Format options |