Redigera

Dela via


RuntimeHelpers.OffsetToStringData Property

Definition

Caution

OffsetToStringData is obsolete. Use string.GetPinnableReference() instead.

Caution

OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.

Gets the offset, in bytes, to the data in the given string.

public:
 static property int OffsetToStringData { int get(); };
public static int OffsetToStringData { get; }
[System.Obsolete("OffsetToStringData is obsolete. Use string.GetPinnableReference() instead.")]
public static int OffsetToStringData { get; }
[System.Obsolete("OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.")]
public static int OffsetToStringData { get; }
static member OffsetToStringData : int
[<System.Obsolete("OffsetToStringData is obsolete. Use string.GetPinnableReference() instead.")>]
static member OffsetToStringData : int
[<System.Obsolete("OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.")>]
static member OffsetToStringData : int
Public Shared ReadOnly Property OffsetToStringData As Integer

Property Value

The byte offset, from the start of the String object to the first character in the string.

Attributes

Remarks

Compilers use this property for unsafe, but efficient, pointer operations on the characters in a managed string. Compilers should pin the string against movement by the garbage collector before use. Note that common language runtime strings are immutable; that is, their contents can be read but not changed.

Applies to