Skip to content

StringAssertions.StartWith Method ​

Definition ​

Asserts that the string starts with the specified value.

c#
public AssertionsChain<StringAssertions, string> StartWith(string expected, StringComparison comparison = StringComparison.System.StringComparison);

View source

Parameters ​

NameTypeDescription
expectedStringThe expected start of the string.
comparisonStringComparisonThe StringComparison to use. Defaults to Ordinal.

Returns ​

AssertionsChain<StringAssertions, String>

An AssertionsChain<TAssertions, T> for chaining further assertions.