Skip to content

Latest commit

 

History

History
81 lines (51 loc) · 3.28 KB

Assorted.Utils.Text.StringExtensions.LastPartition.md

File metadata and controls

81 lines (51 loc) · 3.28 KB

StringExtensions.LastPartition Method

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.

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.

Syntax

public static ValueTuple<string, string> LastPartition(this string source, char separator)

Parameters

source: string
The source string.

separator: char
The separator Unicode character.

Return Value

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.

Exceptions

Exception Description
System.ArgumentNullException source is null.

See Also

LastPartition(this string, string)

Splits the string at the last occurrence of a specified string and returns the substrings before and after the separator.

Syntax

public static ValueTuple<string, string> LastPartition(this string source, string separator)

Parameters

source: string
The source string.

separator: string
The separator string.

Return Value

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.

Exceptions

Exception Description
System.ArgumentNullException source or separator is null.

See Also


This document is generated by DG.