< Dice‎ | AST‎ | DiceAST

DiceAST.ToString Method ()

From DiceRoller Documentation

Retrieves a normalized representation of the dice expression.

  • Namespace: Dice.AST
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

public abstract override string ToString()

Return Value

Type: System.String

Normalized representation of the dice expression. This may differ from the exact string that was typed in by the user.

Remarks

The normalized representation of the expression represents all extras in their function form, and re-orders functions so that they go left-to-right in the order of their FunctionTiming. Casing is additionally normalized to the function casing used when registering the function. If there are nested rolls, these are fully evaluated and their results placed into the appropriate spot.

For example, if a() was registered as a roll function with FunctionTiming.First and b() and c() were both registered with FunctionTiming.Last, the dice expression 1d20rr<2rr>19.c().a().b() would have the following string value: 1d20.a().reroll(<2, >19).c().b().