RuntimeHelpers.OffsetToStringData 屬性

定義

警告

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

警告

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

取得位元組,對給定字串中資料的偏移量。

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

屬性值

位元組偏移量,從物件起始 String 點到字串的第一個字元。

屬性

備註

編譯器會利用此特性來對受管理字串中字元進行不安全但高效的指標操作。 編譯器在使用前應將字串釘在垃圾回收器的移動方向上。 請注意,通用語言執行時字串是不可變的;也就是說,內容可以被閱讀但無法更改。

適用於