Namespace: Assorted.Utils.Text
Assembly: Assorted.Utils (Assorted.Utils.dll) version 1.1.0.0
Overload | Description |
---|---|
LastPartition(this string, char) | Splits the string at the last occurrence of a specified Unicode character and returns the substrings before and after the separator. |
LastPartition(this string, string) | Splits the string at the last occurrence of a specified string and returns the substrings before and after the separator. |
Splits the string at the last occurrence of a specified Unicode character and returns the substrings before and after the separator.
public static ValueTuple<string, string> LastPartition(this string source, char separator)
source
: string
The source string.
separator
: char
The separator Unicode character.
ValueTuple<string, string>
A System.Tuple<T1, T2>
containing the substring before and after the last occurrences of the specified separator
if the separator is found; otherwise, the first item in the tuple is null
and the second item is the source
string itself.
Exception | Description |
---|---|
System.ArgumentNullException | source is null . |
Splits the string at the last occurrence of a specified string and returns the substrings before and after the separator.
public static ValueTuple<string, string> LastPartition(this string source, string separator)
source
: string
The source string.
separator
: string
The separator string.
ValueTuple<string, string>
A System.Tuple<T1, T2>
containing the substring before and after the last occurrences of the specified separator
if the separator is found; otherwise, the first item in the tuple is null
and the second item is the source
string itself.
Exception | Description |
---|---|
System.ArgumentNullException | source or separator is null . |
This document is generated by DG.