StringManipulation.SplitLast Method

Namespace
Kampute.DocToolkit.Support
Assembly
  • Kampute.DocToolkit.dll

Definition

Splits a string into two parts at the last occurrence of the specified separator character.
public static ValueTuple<string, string> SplitLast(this string text, char separator)

Parameters

text string
The string to split.
separator char
The character to use as the separator for splitting the string.

Returns

ValueTuple<string, string>
A tuple containing two substrings:
  1. The substring before the last occurrence of the separator, or an empty string if the separator is not found.
  2. The substring after the last occurrence of the separator, or the entire string if the separator is not found.