Table of Contents

Method IndexOfBytes

Namespace
MongoDB.Driver.Linq
Assembly
MongoDB.Driver.dll

IndexOfBytes(string, string)

Searches a string for an occurrence of a substring and returns the UTF-8 byte index (zero-based) of the first occurrence.

public static int IndexOfBytes(this string s, string value)

Parameters

s string

The string.

value string

The value.

Returns

int

The byte index of the first occurrence, or -1 if not found.

IndexOfBytes(string, string, int)

Searches a string for an occurrence of a substring and returns the UTF-8 byte index (zero-based) of the first occurrence.

public static int IndexOfBytes(this string s, string value, int startIndex)

Parameters

s string

The string.

value string

The value.

startIndex int

The start index.

Returns

int

The byte index of the first occurrence, or -1 if not found.

IndexOfBytes(string, string, int, int)

Searches a string for an occurrence of a substring and returns the UTF-8 byte index (zero-based) of the first occurrence.

public static int IndexOfBytes(this string s, string value, int startIndex, int count)

Parameters

s string

The string.

value string

The value.

startIndex int

The start index.

count int

The count.

Returns

int

The byte index of the first occurrence, or -1 if not found.