# StartWith

## ShouldStartWith

```cs
var target = "Homer";
target.ShouldStartWith("Bart");
```

[snippet source](https://github.com/shouldly/shouldly/blob/master/src/DocumentationExamples/CodeExamples/StringExamples.ShouldStartWith.codeSample.approved.cs#L1-L2) | [anchor](#snippet-StringExamples.ShouldStartWith.codeSample.approved.cs)

**Exception**

```
target
    should start with
"Bart"
    but was
"Homer"
```

## ShouldNotStartWith

```cs
var target = "Homer Simpson";
target.ShouldNotStartWith("Homer");
```

[snippet source](https://github.com/shouldly/shouldly/blob/master/src/DocumentationExamples/CodeExamples/StringExamples.ShouldNotStartWith.codeSample.approved.cs#L1-L2) | [anchor](#snippet-StringExamples.ShouldNotStartWith.codeSample.approved.cs)

**Exception**

```
target
    should not start with
"Homer"
    but was
"Homer Simpson"
```
