StringExtensions.LeftBeforeLast Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

LeftBeforeLast(string, string, StringComparison?)

Returns a string containing every character within a string before (left) the last occurrence of another string.

public static string LeftBeforeLast(this string original, string search, StringComparison? comparisonType = default(StringComparison? ))

Parameters

original
string

Required. String expression from which the leftmost characters are returned.

search
string

The string where the beginning of it marks the characters to return. If the string is not found, the whole string is returned.

comparisonType
System.StringComparison?

Determines whether or not to use case sensitive search.

Returns

string

A string containing every character within the original string before the last occurrence of the search string.