StringManipulation.SubstringBeforeOrSelf Method

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

Definition

Returns the section of a string before the first occurrence of the specified character.
public static string SubstringBeforeOrSelf(this string text, char separator)

Parameters

text string
The string to process.
separator char
The separator character.

Returns

string
The part of the substring before the first occurrence of the separator character or the entire string if the separator is not found.