Header menu logo TDesu.FSharp

String Module

Every partial pattern here returns a struct ValueOption via [<return: Struct>]. A plain partial pattern allocates one FSharpOption per evaluated match arm, which for patterns this small — used in hot parse and validation loops — is the entire cost of the match. The attribute is invisible at the use site: the syntax of a match arm is identical either way.

Active patterns

Active pattern Description

(|EmptyOrWhiteSpace|_|) str

Full Usage: (|EmptyOrWhiteSpace|_|) str

Parameters:
    str : string

Returns: bool
Modifiers: inline

Matches when the string is empty or contains only whitespace. Does not match null. The string to test.

str : string
Returns: bool

(|Empty|_|) str

Full Usage: (|Empty|_|) str

Parameters:
    str : string

Returns: bool
Modifiers: inline

Matches when the string has zero length. Does not match null. The string to test.

str : string
Returns: bool

(|NullOrWhiteSpace|_|) str

Full Usage: (|NullOrWhiteSpace|_|) str

Parameters:
    str : string

Returns: bool
Modifiers: inline

Matches when the string is null, empty, or whitespace. The string to test.

str : string
Returns: bool

(|StartsWithAny|_|) values str

Full Usage: (|StartsWithAny|_|) values str

Parameters:
    values : string[]
    str : string

Returns: bool
Modifiers: inline

Matches when the string starts with any of the given values. The prefixes to check against. The string to test.

values : string[]
str : string
Returns: bool

(|WhiteSpaces|_|) str

Full Usage: (|WhiteSpaces|_|) str

Parameters:
    str : string

Returns: bool
Modifiers: inline

Matches when the string contains only whitespace characters and has length > 1. Does not match null. The string to test.

str : string
Returns: bool

(|WhiteSpace|_|) str

Full Usage: (|WhiteSpace|_|) str

Parameters:
    str : string

Returns: bool
Modifiers: inline

Matches when the string is exactly a single whitespace character. Does not match null. The string to test.

str : string
Returns: bool

Type something to start searching.