x4Trace Documentation v1.0
Loading...
Searching...
No Matches
Tools.StringTool Class Reference

Represents a string handling class. More...

Static Public Member Functions

static string GetReplacedString (string str, string exChars)
 Replaces the caracters to an empty character.
 
static string ToStringAsNumber (string number, int decimals, bool wZero)
 Shows the number by separated decimals.
 
static string ToStringAsNumber (decimal number, int decimals, bool wZero, bool zeroIsEmpty=false)
 Shows the number by separated decimals.
 
static string ToStringAsNumber (string number)
 Shows the number by separated decimals.
 
static string ToStringAsNumber3 (string number, int decimals=2, bool zeroIsEmpty=false)
 Shows the number by separated decimals, splitted by thousands.
 
static string ToStringAsNumber3 (decimal number, int decimals=2, bool zeroIsEmpty=false)
 Shows the number by separated decimals, splitted by thousands.
 
static string ToStringAsNumberSplit3 (string val, string sep=" ")
 Shows the number by separated decimals, splitted by thousands.
 
static string ToStringAsInterval (DateTime dt1, DateTime dt2)
 Shows the interval of dates as string.
 

Static Private Member Functions

static string Reverse (string str)
 Returns the reverse of string.
 

Detailed Description

Represents a string handling class.

Member Function Documentation

◆ GetReplacedString()

static string Tools.StringTool.GetReplacedString ( string str,
string exChars )
static

Replaces the caracters to an empty character.

Parameters
strString to replace.
exCharsCharacters to eliniminate.
Returns
The eliniminated sting.

◆ Reverse()

static string Tools.StringTool.Reverse ( string str)
staticprivate

Returns the reverse of string.

Parameters
strString to reverse.
Returns
The reversed string.

◆ ToStringAsInterval()

static string Tools.StringTool.ToStringAsInterval ( DateTime dt1,
DateTime dt2 )
static

Shows the interval of dates as string.

Parameters
dt1Date from.
dt2Date to.
Returns
Interval of dates as string.

◆ ToStringAsNumber() [1/3]

static string Tools.StringTool.ToStringAsNumber ( decimal number,
int decimals,
bool wZero,
bool zeroIsEmpty = false )
static

Shows the number by separated decimals.

Parameters
numberThe number as decimal.
decimalsDecimals to show.
wZeroRound to zero.
zeroIsEmptyThe zero is an empty string.
Returns
The number as string.

◆ ToStringAsNumber() [2/3]

static string Tools.StringTool.ToStringAsNumber ( string number)
static

Shows the number by separated decimals.

Parameters
numberThe number as string.
Returns
The number as string.

◆ ToStringAsNumber() [3/3]

static string Tools.StringTool.ToStringAsNumber ( string number,
int decimals,
bool wZero )
static

Shows the number by separated decimals.

Parameters
numberThe number as string.
decimalsDecimals to show.
wZeroRound to zero.
Returns
The number as string.

◆ ToStringAsNumber3() [1/2]

static string Tools.StringTool.ToStringAsNumber3 ( decimal number,
int decimals = 2,
bool zeroIsEmpty = false )
static

Shows the number by separated decimals, splitted by thousands.

Parameters
numberThe number as decimal.
decimalsDecimals to show.
zeroIsEmptyThe zero is an empty string.
Returns
The number as string.

◆ ToStringAsNumber3() [2/2]

static string Tools.StringTool.ToStringAsNumber3 ( string number,
int decimals = 2,
bool zeroIsEmpty = false )
static

Shows the number by separated decimals, splitted by thousands.

Parameters
numberThe number as string.
decimalsDecimals to show.
zeroIsEmptyThe zero is an empty string.
Returns
The number as string.

◆ ToStringAsNumberSplit3()

static string Tools.StringTool.ToStringAsNumberSplit3 ( string val,
string sep = " " )
static

Shows the number by separated decimals, splitted by thousands.

Parameters
valThe number as string.
sepSeparator character.
Returns
The number as string.

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