Helper class for string formatting using simple placeholder patterns.
class
|
Format
|
base of
|
Format_1
|
||
Format_N
|
|||||
Format_StringBuilder
|
A
format
pattern
is
a
string
with
embedded
placeholders
(#
or
@
characters):
"Some String with # placeholders @ in it."The placeholders are replaced one after another (from left to right) by calling one of the following methods for each placeholder: Use the
##
and
@@
tokens
in
order
to
insert
a
plain
#
resp.
@
character
in
the
pattern.
Returns the number of decimal digits necessary for writing the given integer number.
[Pure]
|
||||
public
static
method
|
DecimalDigits
(int64 number)
|
|||
type
|
int32
|
|||
params
|
number
|
The integer number. | ||
returns
|
|
The number of needed decimal digits. |
Specifies the digit count to use for integer values (see Digits ).
[Pure]
|
||||
public
static
method
|
Digits
(int32 digits)
|
|||
type
|
FormatFlags
|
|||
params
|
digits
|
[0..64]
|
The number of digits. | |
returns
|
The FormatFlags value. |
Formats a pattern with eight placeholders.
[Pure]
|
||||
public
static
method
|
Eight
(string pattern)
|
|||
type
|
Format_8
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Specifies the decimal exponent to use for formatting integer values (see Exponent).
[Pure]
|
||||
public
static
method
|
Exponent
(int32 decimalExponent)
|
|||
type
|
FormatFlags
|
|||
params
|
decimalExponent
|
[-32767..32767]
|
The decimal exponent. | |
returns
|
The format flags value. |
Formats a pattern with five placeholders.
[Pure]
|
||||
public
static
method
|
Five
(string pattern)
|
|||
type
|
Format_5
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats a pattern with four placeholders.
[Pure]
|
||||
public
static
method
|
Four
(string pattern)
|
|||
type
|
Format_4
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats a pattern with any number of placeholders.
[Pure]
|
||||
public
static
method
|
Many
(string pattern)
|
|||
type
|
Format_N
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Calling ToString on the returned object will finish the formatting.
Formats a pattern with nine placeholders.
[Pure]
|
||||
public
static
method
|
Nine
(string pattern)
|
|||
type
|
Format_9
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats a pattern with one placeholder.
[Pure]
|
||||
public
static
method
|
One
(string pattern)
|
|||
type
|
Format_1
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
object b)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(object a,
string b)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(object a,
object b)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
char b)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(char a,
string b)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
string b)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(object a,
object b,
object c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
object b,
object c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(object a,
string b,
object c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(object a,
object b,
string c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(object a,
string b,
string c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
object b,
string c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
string b,
object c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(char a,
string b,
string c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
char b,
string c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
string b,
char c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats the given values in a row, one after another (simple concatenation).
[Pure]
|
||||
public
static
method
|
Row
(string a,
string b,
string c)
|
|||
type
|
string
|
|||
params
|
a
|
The first value. | ||
b
|
The second value. | |||
c
|
The third value. | |||
returns
|
|
The formatted value. |
Formats a pattern with seven placeholders.
[Pure]
|
||||
public
static
method
|
Seven
(string pattern)
|
|||
type
|
Format_7
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats a pattern with six placeholders.
[Pure]
|
||||
public
static
method
|
Six
(string pattern)
|
|||
type
|
Format_6
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats the given boolean as a string.
[Pure]
|
||||
public
static
method
|
ThisBool
(bool b,
string ifTrue = "true",
string ifFalse = "false")
|
|||
type
|
string
|
|||
params
|
b
|
The boolean value. | ||
ifTrue
|
[not-null]
|
The
string
value
to
use
for
true . |
||
ifFalse
|
[not-null]
|
The
string
value
to
use
for
false . |
||
returns
|
|
The string formatted boolean. |
See also:
Parse.NumberFormats the given character as a string.
[Pure]
|
||||
public
static
method
|
ThisChar
(char c,
int32 repeat = 1)
|
|||
type
|
string
|
|||
params
|
c
|
The character value. | ||
repeat
|
[>=0]
|
Number of times to repeat c. | ||
returns
|
|
The string formatted character. |
See also:
Parse.NumberFormats the given number as a string.
[Pure]
|
||||
public
static
method
|
ThisInt
(int64 number,
FormatFlags flags = FormatFlags.Default)
|
|||
type
|
string
|
|||
params
|
number
|
The number value. | ||
flags
|
The number format flags to use. | |||
returns
|
|
The string formatted number. |
See also:
Parse.IntegerFormats the given number as a string.
[Pure]
|
||||
public
static
method
|
ThisNum
(float64 number,
FormatFlags flags = FormatFlags.Default)
|
|||
type
|
string
|
|||
params
|
number
|
The number value. | ||
flags
|
The number format flags to use. | |||
returns
|
|
The string formatted number. |
See also:
Parse.NumberFormats the given object reference.
[Pure]
|
||||
public
static
method
|
ThisObj
(object obj)
|
|||
type
|
string
|
|||
params
|
obj
|
The object reference. | ||
returns
|
|
The string formatted object reference. |
Formats a pattern with three placeholders.
[Pure]
|
||||
public
static
method
|
Three
(string pattern)
|
|||
type
|
Format_3
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
Formats a pattern with two placeholders.
[Pure]
|
||||
public
static
method
|
Two
(string pattern)
|
|||
type
|
Format_2
|
|||
params
|
pattern
|
The pattern. | ||
returns
|
|
The pattern formatter. |
Remarks:
Formatting is finished automatically after all placeholder have been specified.
The internally used string builder object.
protected
readonly
field
|
builder
|
||
type
|
StringBuilder
|
Finishes formatting.
protected
method
|
Finish
()
|
||
type
|
string
|
||
returns
|
The resulting string. |
Remarks:
The string builder will be cleared by this method.
Finishes formatting.
protected
method
|
FinishBuilder
()
|
Remarks:
The string builder will contain the resulting string.
Moves to the next placeholder, if existent.
protected
method
|
Next
()
|
||
type
|
bool
|
||
returns
|
true
if
the
placeholder
exists,
false
if
there
are
no
more
placeholders.
|