RuntimeHelpers.OffsetToStringData 属性

定义

注意

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

注意

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

获取给定字符串中数据的偏移量(以字节为单位)。

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

属性值

字节偏移量,从 String 对象的起始位置到字符串中的第一个字符。

属性

注解

编译器使用此属性对托管字符串中的字符执行不安全但高效的指针操作。 编译器应在使用前将字符串固定到垃圾回收器移动。 请注意,公共语言运行时字符串是不可变的;也就是说,可以读取其内容,但不能更改。

适用于