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
textstring- The string to split.
separatorchar- The character to use as the separator for splitting the string.
Returns
- ValueTuple<string, string>
- A tuple containing two substrings:
- The substring before the last occurrence of the separator, or an empty string if the separator is not found.
- The substring after the last occurrence of the separator, or the entire string if the separator is not found.
