Method Parse
- Namespace
- DocWright.Core.Primitives
- Assembly
- DocWright.Core.dll
Parse(string)
Parses a page selection such as 1-3,7,12-, 4 or all.
public static PageRange Parse(string text)
Parameters
textstringThe selection text. Whitespace around items and separators is ignored.
Returns
- PageRange
The parsed selection.
Remarks
The grammar is deliberately the one people already type into a print dialog: comma-
separated items, each a page number, a first-last span, or a first- tail
that runs to the end of the document. Parsing is ordinal and invariant, so the result
does not depend on the current culture.
Exceptions
- ArgumentNullException
textis null.- FormatException
textis not a valid selection.