2025-05-01 01:48:08 -07:00

1.6 KiB
Raw Blame History

Sub String Formatter

Use SubString Formatter to output parts of an input string. If the value is not a string it is first converted to one using the values ToString method.

Diagram showing the breakdown of the Smart String and how each part is evaluated.

Diagram showing the breakdown of the Smart String and how each part is evaluated.

Field Description
Parameter Delimiter The character used to separate the start and length value. By default it uses a comma.
Null Display String The string to display if the string being formatter is null.
Out Of Range Behavior Defines what to do if the substring position or length goes out of the range of the provided string.
  • Return Empty String - Returns String.Empty.
  • Return Start Index To End Of String - Returns the remainder of the string starting at start index.
  • Throw Exception - Throws a FormattingException.
Example Smart String Arguments Result
{0:substr(5)} "Long John" John
{0:substr(0, 3)} "New York" New
Hello {name:substr(1)} {surname}

[!code-cs]

Hello L Croft