Format

Description

class Tinman.Core.Formatting.Format

Extended by

Format_1
Format_N sealed
Format_StringBuilder sealed

Helper class for string formatting using simple placeholder patterns.

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.

Public / Methods

Decimal​Digits


[Pure]
public static method DecimalDigits → (1)

number in : int64

The integer number.

returns → int32

The number of needed decimal digits.

Returns the number of decimal digits necessary for writing the given integer number.

Digits


[Pure]
public static method Digits → (1)

digits in : int32

[0..64]
The number of digits.

returns → FormatFlags

The FormatFlags value.

Specifies the digit count to use for integer values (see FormatFlags.Digits).

Eight


[Pure]
public static method Eight → (1)

pattern in : string

The pattern.

returns → Format_8

The pattern formatter.

Formats a pattern with eight placeholders.

Formatting is finished automatically after all placeholder have been specified.

Exponent


[Pure]
public static method Exponent → (1)

decimalExponent in : int32

[-32767..32767]
The decimal exponent.

returns → FormatFlags

The format flags value.

Specifies the decimal exponent to use for formatting integer values (see FormatFlags.Exponent).

Five


[Pure]
public static method Five → (1)

pattern in : string

The pattern.

returns → Format_5

The pattern formatter.

Formats a pattern with five placeholders.

Formatting is finished automatically after all placeholder have been specified.

Four


[Pure]
public static method Four → (1)

pattern in : string

The pattern.

returns → Format_4

The pattern formatter.

Formats a pattern with four placeholders.

Formatting is finished automatically after all placeholder have been specified.

Many


[Pure]
public static method Many → (1)

pattern in : string

The pattern.

returns → Format_N

The pattern formatter.

Formats a pattern with any number of placeholders.

Calling object.ToString on the returned object will finish the formatting.

Nine


[Pure]
public static method Nine → (1)

pattern in : string

The pattern.

returns → Format_9

The pattern formatter.

Formats a pattern with nine placeholders.

Formatting is finished automatically after all placeholder have been specified.

One


[Pure]
public static method One → (1)

pattern in : string

The pattern.

returns → Format_1

The pattern formatter.

Formats a pattern with one placeholder.

Formatting is finished automatically after all placeholder have been specified.

Row

17 overloads


[Pure]
public static method Row1 → (2)

in : string

The first value.

in : object

The second value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row2 → (2)

in : object

The first value.

in : string

The second value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row3 → (2)

in : object

The first value.

in : object

The second value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row4 → (2)

in : string

The first value.

in : char

The second value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row5 → (2)

in : char

The first value.

in : string

The second value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row6 → (2)

in : string

The first value.

in : string

The second value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row7 → (3)

in : object

The first value.

in : object

The second value.

in : object

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row8 → (3)

in : string

The first value.

in : object

The second value.

in : object

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row9 → (3)

in : object

The first value.

in : string

The second value.

in : object

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row10 → (3)

in : object

The first value.

in : object

The second value.

in : string

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row11 → (3)

in : object

The first value.

in : string

The second value.

in : string

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row12 → (3)

in : string

The first value.

in : object

The second value.

in : string

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row13 → (3)

in : string

The first value.

in : string

The second value.

in : object

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row14 → (3)

in : char

The first value.

in : string

The second value.

in : string

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row15 → (3)

in : string

The first value.

in : char

The second value.

in : string

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row16 → (3)

in : string

The first value.

in : string

The second value.

in : char

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).


[Pure]
public static method Row17 → (3)

in : string

The first value.

in : string

The second value.

in : string

The third value.

returns → string

The formatted value.

Formats the given values in a row, one after another (simple concatenation).

Seven


[Pure]
public static method Seven → (1)

pattern in : string

The pattern.

returns → Format_7

The pattern formatter.

Formats a pattern with seven placeholders.

Formatting is finished automatically after all placeholder have been specified.

Six


[Pure]
public static method Six → (1)

pattern in : string

The pattern.

returns → Format_6

The pattern formatter.

Formats a pattern with six placeholders.

Formatting is finished automatically after all placeholder have been specified.

This​Bool


[Pure]
public static method ThisBool → (3)

in : bool

The boolean value.

ifTrue opt : string = "true"

[not-null]
The string value to use for true.

ifFalse opt : string = "false"

[not-null]
The string value to use for false.

returns → string

The string formatted boolean.

Formats the given boolean as a string.

This​Char


[Pure]
public static method ThisChar → (2)

in : char

The character value.

repeat opt : int32 = 1

[>=0]
Number of times to repeat in.

returns → string

The string formatted character.

Formats the given character as a string.

This​Int


[Pure]
public static method ThisInt → (2)

number in : int64

The number value.

flags opt : FormatFlags = FormatFlags.Default

The number format flags to use.

returns → string

The string formatted number.

Formats the given number as a string.

This​Num


[Pure]
public static method ThisNum → (2)

number in : float64

The number value.

flags opt : FormatFlags = FormatFlags.Default

The number format flags to use.

returns → string

The string formatted number.

Formats the given number as a string.

This​Obj


[Pure]
public static method ThisObj → (1)

obj in : object

The object reference.

returns → string

The string formatted object reference.

Formats the given object reference.

Three


[Pure]
public static method Three → (1)

pattern in : string

The pattern.

returns → Format_3

The pattern formatter.

Formats a pattern with three placeholders.

Formatting is finished automatically after all placeholder have been specified.

Two


[Pure]
public static method Two → (1)

pattern in : string

The pattern.

returns → Format_2

The pattern formatter.

Formats a pattern with two placeholders.

Formatting is finished automatically after all placeholder have been specified.

Protected / Methods

Finish


protected method Finish → ()

returns → string

The resulting string.

Finishes formatting.

The string builder will be cleared by this method.

Finish​Builder


protected method FinishBuilder → ()

Finishes formatting.

The string builder will contain the resulting string.

Next


protected method Next → ()

returns → bool

true if the placeholder exists, false if there are no more placeholders.

Moves to the next placeholder, if existent.

Protected / Attributes

builder


protected readonly attribute builder → (StringBuilder)

The internally used string builder object.