string

Description

sealed class System.string

Derived from

IEquatable<string>

A sequence of characters.

Public / Methods

Contains


public method Contains → (1)

other in : string

The other string.

returns → bool

true if this string contains other in,
false if it does not.

Checks if this string contains the given other in one.

Ends​With


public method EndsWith → (1)

other in : string

The other string.

returns → bool

true if this string ends with other in,
false if it does not.

Checks if this string ends with the given other in one.

Index​Of

2 overloads


public method IndexOf1 → (1)

other in : string

The other string.

returns → int32

Index of the first character of the first occurrence of other in in this string or -1 iff other in is not contained in this string.

Finds the first occurrence of the given other in string in this string.


public method IndexOf2 → (2)

other in : string

The other string.

startIndex in : int32

[0..string.Length]
Index of the first character in this string to include in the search.

returns → int32

Index of the first character of the first occurrence of other in in this string or -1 iff other in is not contained in this string.

Finds the first occurrence of the given other in string in this string.

Last​Index​Of

2 overloads


public method LastIndexOf1 → (1)

other in : string

The other string.

returns → int32

Index of the first character of the last occurrence of other in in this string or -1 iff other in is not contained in this string.

Finds the last occurrence of the given other in string in this string.


public method LastIndexOf2 → (2)

other in : string

The other string.

startIndex in : int32

[0..string.Length]
Index of the first character in this string to include in the search.

returns → int32

Index of the first character of the last occurrence of other in in this string or -1 iff other in is not contained in this string.

Finds the last occurrence of the given other in string in this string.

Replace


public method Replace → (2)

in : char

The character to replace.

in : char

The replacement character.

returns → string

The resulting string.

Replaces all occurrences of in in this string with in.

Starts​With


public method StartsWith → (1)

other in : string

The other string.

returns → bool

true if this string starts with other in,
false if it does not.

Checks if this string starts with the given other in one.

Substring

2 overloads


public method Substring1 → (1)

startIndex in : int32

[0..string.Length]
Index of the first character to extract.

returns → string

The resulting string.

Returns a substring of this string, specified by starting index.


public method Substring2 → (2)

startIndex in : int32

[0..string.Length]
Index of the first character to extract.

length in : int32

[0..string.Length-startIndex]
Number of characters to extract.

returns → string

The resulting string.

Returns a substring of this string, specified by starting index and length.

Trim


public method Trim → ()

returns → string

The resulting string.

Removes both leading and trailing Unicode Whitespace characters from this string.

Public / Attributes

Length


public attribute Length → (get)

value : int32

[>=0]
The string length, in characters.

Returns the length of the string.