StringSegment.IndexOf Method

Definition

Overloads

IndexOf(Char, Int32, Int32)

Gets the zero-based index of the first occurrence of the character c in this StringSegment. The search starts at start and examines a specified number of count character positions.

IndexOf(Char)

Gets the zero-based index of the first occurrence of the character c in this StringSegment.

IndexOf(Char, Int32)

Gets the zero-based index of the first occurrence of the character c in this StringSegment. The search starts at start.

IndexOf(Char, Int32, Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Gets the zero-based index of the first occurrence of the character c in this StringSegment. The search starts at start and examines a specified number of count character positions.

C#
public int IndexOf(char c, int start, int count);

Parameters

c
Char

The Unicode character to seek.

start
Int32

The zero-based index position at which the search starts.

count
Int32

The number of characters to examine.

Returns

The zero-based index position of c from the beginning of the StringSegment if that character is found, or -1 if it is not.

Exceptions

start or count is less than zero, or start + count is greater than Length.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

IndexOf(Char)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Gets the zero-based index of the first occurrence of the character c in this StringSegment.

C#
public int IndexOf(char c);

Parameters

c
Char

The Unicode character to seek.

Returns

The zero-based index position of c from the beginning of the StringSegment if that character is found, or -1 if it is not.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

IndexOf(Char, Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Gets the zero-based index of the first occurrence of the character c in this StringSegment. The search starts at start.

C#
public int IndexOf(char c, int start);

Parameters

c
Char

The Unicode character to seek.

start
Int32

The zero-based index position at which the search starts.

Returns

The zero-based index position of c from the beginning of the StringSegment if that character is found, or -1 if it is not.

Exceptions

start is greater than or equal to Length or less than zero.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)