Skip to content

LeftOf Method ​

Definition ​

  • Namespace: JASE.Extensions
  • Assembly: JASE.Primitives.dll

string LeftOf(string input, string value, bool trim = null) ​

csharp
string LeftOf(string input, string value, bool trim = null)

Returns the substring of input that appears to the left of the first occurrence of value.

Parameters ​

NameDescription
inputThe source string. If null or empty, it is returned unchanged.
trimWhen , trims whitespace from the returned substring.
valueThe marker string to search for. If null, empty, or not found within input, the full input is returned.

Returns ​

The portion of input before value. If value is not found, the original string is returned.