Table of Contents

SubstringBefore Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/StringExtensions.cs

SubstringBefore(string, string, StringComparison)

Retrieves a substring from the specified value. The substring starts at position 0 and continues until the first occurrence of match.

public static string SubstringBefore(this string value, string match, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)

Parameters

value string

The string to extend.

match string

The match that will define the stopping point.

comparisonType StringComparison

One of the enumeration values that specifies the rules for the search.

Returns

string

A substring that contains only the value just before match.