New to Telerik UI for WinForms? Start a free 30-day trial

Splits a field instruction into text and switch tokens.

Definition

Namespace:Telerik.WinForms.Documents.FormatProviders.Utils

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class FieldTokenizer

Inheritance: objectFieldTokenizer

Constructors

C#
public FieldTokenizer()

Methods

Tokenizes a field instruction after trimming outer whitespace. A leading backslash introduces a switch and is not included in its token text.

C#
public static FieldToken[] Tokenize(string source)
Parameters:sourcestring

The field instruction to parse.

Returns:

FieldToken[]

The text and switch tokens in order; repeated internal whitespace can produce empty text tokens.

Exceptions: FormatException

A quoted token is unterminated or followed by non-whitespace text, or a switch prefix has no following character.