FSharpx.Extras


String Module

Functional wrappers around String instance methods

Functions and values

Function or value Description

compare comparisonType strA strB

Full Usage: compare comparisonType strA strB

Parameters:
Returns: int
Modifiers: inline

Compares two specified String objects and returns an integer that indicates their relative position in the sort order.

comparisonType : StringComparison
strA : string
strB : string
Returns: int

compareIgnoreCase strA strB

Full Usage: compareIgnoreCase strA strB

Parameters:
    strA : string
    strB : string

Returns: int
Modifiers: inline

Compares two specified String objects and returns an integer that indicates their relative position in the sort order. Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared.

strA : string
strB : string
Returns: int

contains value s

Full Usage: contains value s

Parameters:
    value : string
    s : string

Returns: bool
Modifiers: inline

Returns a value indicating whether a specified substring occurs within this string.

value : string
s : string
Returns: bool

endsWith value s

Full Usage: endsWith value s

Parameters:
    value : string
    s : string

Returns: bool
Modifiers: inline

Determines whether the end of this string instance matches the specified string.

value : string
s : string
Returns: bool

endsWith' value ignoreCase culture s

Full Usage: endsWith' value ignoreCase culture s

Parameters:
    value : string
    ignoreCase : bool
    culture : CultureInfo
    s : string

Returns: bool
Modifiers: inline

Determines whether the end of this string instance matches the specified string when compared using the specified culture.

value : string
ignoreCase : bool
culture : CultureInfo
s : string
Returns: bool

endsWith'' value comparisonType s

Full Usage: endsWith'' value comparisonType s

Parameters:
Returns: bool
Modifiers: inline

Determines whether the end of this string instance matches the specified string when compared using the specified comparison option.

value : string
comparisonType : StringComparison
s : string
Returns: bool

equals comparisonType a b

Full Usage: equals comparisonType a b

Parameters:
Returns: bool
Modifiers: inline

Determines whether two specified String objects have the same value.

comparisonType : StringComparison
a : string
b : string
Returns: bool

equalsIgnoreCase a b

Full Usage: equalsIgnoreCase a b

Parameters:
    a : string
    b : string

Returns: bool
Modifiers: inline

Determines whether two specified String objects have the same value. Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared.

a : string
b : string
Returns: bool

indexOfAny anyOf s

Full Usage: indexOfAny anyOf s

Parameters:
    anyOf : char[]
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters.

anyOf : char[]
s : string
Returns: int

indexOfAny' anyOf startIndex s

Full Usage: indexOfAny' anyOf startIndex s

Parameters:
    anyOf : char[]
    startIndex : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position.

anyOf : char[]
startIndex : int
s : string
Returns: int

indexOfAny'' anyOf startIndex count s

Full Usage: indexOfAny'' anyOf startIndex count s

Parameters:
    anyOf : char[]
    startIndex : int
    count : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position and examines a specified number of character positions.

anyOf : char[]
startIndex : int
count : int
s : string
Returns: int

indexOfChar value s

Full Usage: indexOfChar value s

Parameters:
    value : char
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified Unicode character in this string.

value : char
s : string
Returns: int

indexOfChar' value startIndex s

Full Usage: indexOfChar' value startIndex s

Parameters:
    value : char
    startIndex : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character position.

value : char
startIndex : int
s : string
Returns: int

indexOfChar'' value startIndex count s

Full Usage: indexOfChar'' value startIndex count s

Parameters:
    value : char
    startIndex : int
    count : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified character in this instance. The search starts at a specified character position and examines a specified number of character positions.

value : char
startIndex : int
count : int
s : string
Returns: int

indexOfString value s

Full Usage: indexOfString value s

Parameters:
    value : string
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified string in this instance.

value : string
s : string
Returns: int

indexOfString' value startIndex s

Full Usage: indexOfString' value startIndex s

Parameters:
    value : string
    startIndex : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.

value : string
startIndex : int
s : string
Returns: int

indexOfString'' value startIndex count s

Full Usage: indexOfString'' value startIndex count s

Parameters:
    value : string
    startIndex : int
    count : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions.

value : string
startIndex : int
count : int
s : string
Returns: int

indexOfStringWithComparison value comparisonType s

Full Usage: indexOfStringWithComparison value comparisonType s

Parameters:
Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified string in the current String object. A parameter specifies the type of search to use for the specified string.

value : string
comparisonType : StringComparison
s : string
Returns: int

indexOfStringWithComparison' value startIndex comparisonType s

Full Usage: indexOfStringWithComparison' value startIndex comparisonType s

Parameters:
Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified string in the current String object. Parameters specify the starting search position in the current string and the type of search to use for the specified string.

value : string
startIndex : int
comparisonType : StringComparison
s : string
Returns: int

indexOfStringWithComparison'' value startIndex count comparisonType s

Full Usage: indexOfStringWithComparison'' value startIndex count comparisonType s

Parameters:
    value : string
    startIndex : int
    count : int
    comparisonType : StringComparison
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index of the first occurrence of the specified string in the current String object. Parameters specify the starting search position in the current string, the number of characters in the current string to search, and the type of search to use for the specified string.

value : string
startIndex : int
count : int
comparisonType : StringComparison
s : string
Returns: int

insert startIndex value s

Full Usage: insert startIndex value s

Parameters:
    startIndex : int
    value : string
    s : string

Returns: string
Modifiers: inline

Returns a new string in which a specified string is inserted at a specified index position in this instance.

startIndex : int
value : string
s : string
Returns: string

isNormalized s

Full Usage: isNormalized s

Parameters:
    s : string

Returns: bool
Modifiers: inline

Indicates whether this string is in Unicode normalization form C.

s : string
Returns: bool

isNormalized' normalizationForm s

Full Usage: isNormalized' normalizationForm s

Parameters:
Returns: bool
Modifiers: inline

Indicates whether this string is in the specified Unicode normalization form.

normalizationForm : NormalizationForm
s : string
Returns: bool

lastIndexOfChar value s

Full Usage: lastIndexOfChar value s

Parameters:
    value : char
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.

value : char
s : string
Returns: int

lastIndexOfChar' value startIndex s

Full Usage: lastIndexOfChar' value startIndex s

Parameters:
    value : char
    startIndex : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string.

value : char
startIndex : int
s : string
Returns: int

lastIndexOfChar'' value startIndex count s

Full Usage: lastIndexOfChar'' value startIndex count s

Parameters:
    value : char
    startIndex : int
    count : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of the specified Unicode character in a substring within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.

value : char
startIndex : int
count : int
s : string
Returns: int

lastIndexOfString value s

Full Usage: lastIndexOfString value s

Parameters:
    value : string
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of a specified string within this instance.

value : string
s : string
Returns: int

lastIndexOfString' value startIndex s

Full Usage: lastIndexOfString' value startIndex s

Parameters:
    value : string
    startIndex : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string.

value : string
startIndex : int
s : string
Returns: int

lastIndexOfString'' value startIndex count s

Full Usage: lastIndexOfString'' value startIndex count s

Parameters:
    value : string
    startIndex : int
    count : int
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.

value : string
startIndex : int
count : int
s : string
Returns: int

lastIndexOfStringWithComparison value comparisonType s

Full Usage: lastIndexOfStringWithComparison value comparisonType s

Parameters:
Returns: int
Modifiers: inline

Reports the zero-based index of the last occurrence of a specified string within the current String object. A parameter specifies the type of search to use for the specified string.

value : string
comparisonType : StringComparison
s : string
Returns: int

lastIndexOfStringWithComparison' value startIndex comparisonType s

Full Usage: lastIndexOfStringWithComparison' value startIndex comparisonType s

Parameters:
Returns: int
Modifiers: inline

Reports the zero-based index of the last occurrence of a specified string within the current String object. The search starts at a specified character position and proceeds backward toward the beginning of the string. A parameter specifies the type of comparison to perform when searching for the specified string.

value : string
startIndex : int
comparisonType : StringComparison
s : string
Returns: int

lastIndexOfStringWithComparison'' value startIndex count comparisonType s

Full Usage: lastIndexOfStringWithComparison'' value startIndex count comparisonType s

Parameters:
    value : string
    startIndex : int
    count : int
    comparisonType : StringComparison
    s : string

Returns: int
Modifiers: inline

Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for the specified number of character positions. A parameter specifies the type of comparison to perform when searching for the specified string.

value : string
startIndex : int
count : int
comparisonType : StringComparison
s : string
Returns: int

normalize s

Full Usage: normalize s

Parameters:
    s : string

Returns: string
Modifiers: inline

Returns a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C.

s : string
Returns: string

normalize' normalizationForm s

Full Usage: normalize' normalizationForm s

Parameters:
Returns: string
Modifiers: inline

Returns a new string whose textual value is the same as this string, but whose binary representation is in the specified Unicode normalization form.

normalizationForm : NormalizationForm
s : string
Returns: string

padLeft totalWidth s

Full Usage: padLeft totalWidth s

Parameters:
    totalWidth : int
    s : string

Returns: string
Modifiers: inline

Returns a new string that right-aligns the characters in this instance by padding them with spaces on the left, for a specified total length.

totalWidth : int
s : string
Returns: string

padLeft' totalWidth paddingChar s

Full Usage: padLeft' totalWidth paddingChar s

Parameters:
    totalWidth : int
    paddingChar : char
    s : string

Returns: string
Modifiers: inline

Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified Unicode character, for a specified total length.

totalWidth : int
paddingChar : char
s : string
Returns: string

padRight totalWidth s

Full Usage: padRight totalWidth s

Parameters:
    totalWidth : int
    s : string

Returns: string
Modifiers: inline

Returns a new string that left-aligns the characters in this string by padding them with spaces on the right, for a specified total length.

totalWidth : int
s : string
Returns: string

padRight' totalWidth paddingChar s

Full Usage: padRight' totalWidth paddingChar s

Parameters:
    totalWidth : int
    paddingChar : char
    s : string

Returns: string
Modifiers: inline

Returns a new string that left-aligns the characters in this string by padding them on the right with a specified Unicode character, for a specified total length.

totalWidth : int
paddingChar : char
s : string
Returns: string

remove startIndex s

Full Usage: remove startIndex s

Parameters:
    startIndex : int
    s : string

Returns: string
Modifiers: inline

Returns a new string in which all the characters in the current instance, beginning at a specified position and continuing through the last position, have been deleted.

startIndex : int
s : string
Returns: string

remove' startIndex count s

Full Usage: remove' startIndex count s

Parameters:
    startIndex : int
    count : int
    s : string

Returns: string
Modifiers: inline

Returns a new string in which a specified number of characters in the current instance beginning at a specified position have been deleted.

startIndex : int
count : int
s : string
Returns: string

replace oldChar newChar s

Full Usage: replace oldChar newChar s

Parameters:
    oldChar : char
    newChar : char
    s : string

Returns: string
Modifiers: inline

Returns a new string in which all occurrences of a specified Unicode character in this instance are replaced with another specified Unicode character.

oldChar : char
newChar : char
s : string
Returns: string

replace' oldValue newValue s

Full Usage: replace' oldValue newValue s

Parameters:
    oldValue : string
    newValue : string
    s : string

Returns: string
Modifiers: inline

Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.

oldValue : string
newValue : string
s : string
Returns: string

splitChar separator s

Full Usage: splitChar separator s

Parameters:
    separator : char[]
    s : string

Returns: string[]
Modifiers: inline

Splits a string into substrings that are based on the characters in an array.

separator : char[]
s : string
Returns: string[]

splitChar' separator count s

Full Usage: splitChar' separator count s

Parameters:
    separator : char[]
    count : int
    s : string

Returns: string[]
Modifiers: inline

Splits a string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return.

separator : char[]
count : int
s : string
Returns: string[]

splitCharWithOptions separator options s

Full Usage: splitCharWithOptions separator options s

Parameters:
Returns: string[]
Modifiers: inline

Splits a string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements.

separator : char[]
options : StringSplitOptions
s : string
Returns: string[]

splitCharWithOptions' separator count options s

Full Usage: splitCharWithOptions' separator count options s

Parameters:
Returns: string[]
Modifiers: inline

Splits a string into a maximum number of substrings based on the characters in an array.

separator : char[]
count : int
options : StringSplitOptions
s : string
Returns: string[]

splitString separator options s

Full Usage: splitString separator options s

Parameters:
Returns: string[]
Modifiers: inline

Splits a string into substrings based on the strings in an array. You can specify whether the substrings include empty array elements.

separator : string[]
options : StringSplitOptions
s : string
Returns: string[]

splitString' separator count options s

Full Usage: splitString' separator count options s

Parameters:
Returns: string[]
Modifiers: inline

Splits a string into a maximum number of substrings based on the strings in an array. You can specify whether the substrings include empty array elements.

separator : string[]
count : int
options : StringSplitOptions
s : string
Returns: string[]

startsWith value s

Full Usage: startsWith value s

Parameters:
    value : string
    s : string

Returns: bool
Modifiers: inline

Determines whether the beginning of this string instance matches the specified string.

value : string
s : string
Returns: bool

startsWith' value comparisonType s

Full Usage: startsWith' value comparisonType s

Parameters:
Returns: bool
Modifiers: inline

Determines whether the beginning of this string instance matches the specified string when compared using the specified comparison option.

value : string
comparisonType : StringComparison
s : string
Returns: bool

startsWith'' value ignoreCase culture s

Full Usage: startsWith'' value ignoreCase culture s

Parameters:
    value : string
    ignoreCase : bool
    culture : CultureInfo
    s : string

Returns: bool
Modifiers: inline

Determines whether the beginning of this string instance matches the specified string when compared using the specified culture.

value : string
ignoreCase : bool
culture : CultureInfo
s : string
Returns: bool

substring startIndex s

Full Usage: substring startIndex s

Parameters:
    startIndex : int
    s : string

Returns: string
Modifiers: inline

Retrieves a substring from this instance. The substring starts at a specified character position and continues to the end of the string.

startIndex : int
s : string
Returns: string

substring' startIndex length s

Full Usage: substring' startIndex length s

Parameters:
    startIndex : int
    length : int
    s : string

Returns: string
Modifiers: inline

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

startIndex : int
length : int
s : string
Returns: string

toCharArray s

Full Usage: toCharArray s

Parameters:
    s : string

Returns: char[]
Modifiers: inline

Copies the characters in this instance to a Unicode character array.

s : string
Returns: char[]

toCharArray' startIndex length s

Full Usage: toCharArray' startIndex length s

Parameters:
    startIndex : int
    length : int
    s : string

Returns: char[]
Modifiers: inline

Copies the characters in a specified substring in this instance to a Unicode character array.

startIndex : int
length : int
s : string
Returns: char[]

toLower s

Full Usage: toLower s

Parameters:
    s : string

Returns: string
Modifiers: inline

Returns a copy of this string converted to lowercase.

s : string
Returns: string

toLower' culture s

Full Usage: toLower' culture s

Parameters:
Returns: string
Modifiers: inline

Returns a copy of this string converted to lowercase, using the casing rules of the specified culture.

culture : CultureInfo
s : string
Returns: string

toLowerInvariant s

Full Usage: toLowerInvariant s

Parameters:
    s : string

Returns: string
Modifiers: inline

Returns a copy of this String object converted to lowercase using the casing rules of the invariant culture.

s : string
Returns: string

toUpper s

Full Usage: toUpper s

Parameters:
    s : string

Returns: string
Modifiers: inline

Returns a copy of this string converted to uppercase.

s : string
Returns: string

toUpper' culture s

Full Usage: toUpper' culture s

Parameters:
Returns: string
Modifiers: inline

Returns a copy of this string converted to uppercase, using the casing rules of the specified culture.

culture : CultureInfo
s : string
Returns: string

toUpperInvariant s

Full Usage: toUpperInvariant s

Parameters:
    s : string

Returns: string
Modifiers: inline

Returns a copy of this String object converted to uppercase using the casing rules of the invariant culture.

s : string
Returns: string

trim s

Full Usage: trim s

Parameters:
    s : string

Returns: string
Modifiers: inline

Removes all leading and trailing white-space characters from the current String object.

s : string
Returns: string

trim' trimChars s

Full Usage: trim' trimChars s

Parameters:
    trimChars : char array
    s : string

Returns: string
Modifiers: inline

Removes all leading and trailing occurrences of a set of characters specified in an array from the current String object.

trimChars : char array
s : string
Returns: string

trimEnd trimChars s

Full Usage: trimEnd trimChars s

Parameters:
    trimChars : char array
    s : string

Returns: string
Modifiers: inline

Removes all trailing occurrences of a set of characters specified in an array from the current String object.

trimChars : char array
s : string
Returns: string

trimStart trimChars s

Full Usage: trimStart trimChars s

Parameters:
    trimChars : char array
    s : string

Returns: string
Modifiers: inline

Removes all leading occurrences of a set of characters specified in an array from the current String object.

trimChars : char array
s : string
Returns: string