IntPtr.Parse 方法

定義

多載

Parse(String, NumberStyles, IFormatProvider)

將指定樣式與文化特性 (Culture) 特定格式之數字的字串表示法轉換成其對等帶正負號的原生整數。

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

將指定樣式和文化特性特定格式之數位字元表示的唯讀範圍,轉換為其帶正負號的原生整數對等專案。

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

將 UTF-8 字元的範圍剖析為值。

Parse(String, IFormatProvider)

將指定特定文化特性 (Culture) 格式之數字的字串表示法轉換成其對等帶正負號的原生整數。

Parse(String, NumberStyles)

將指定樣式之數字的字串表示法轉換成其對等帶正負號的原生整數。

Parse(ReadOnlySpan<Char>, IFormatProvider)

將字元範圍剖析為值。

Parse(ReadOnlySpan<Byte>, IFormatProvider)

將 UTF-8 字元的範圍剖析為值。

Parse(String)

將數字的字串表示轉換成其對等帶正負號的原生整數。

Parse(String, NumberStyles, IFormatProvider)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

將指定樣式與文化特性 (Culture) 特定格式之數字的字串表示法轉換成其對等帶正負號的原生整數。

public:
 static IntPtr Parse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider);
public:
 static IntPtr Parse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider) = System::Numerics::INumberBase<IntPtr>::Parse;
public static IntPtr Parse (string s, System.Globalization.NumberStyles style, IFormatProvider? provider);
static member Parse : string * System.Globalization.NumberStyles * IFormatProvider -> nativeint
Public Shared Function Parse (s As String, style As NumberStyles, provider As IFormatProvider) As IntPtr

參數

s
String

字串,包含要轉換的數字。

style
NumberStyles

列舉值的位元組合,表示 s 中可以存在的樣式項目。

provider
IFormatProvider

物件,其提供關於 s 的特定文化特性格式資訊。

傳回

IntPtr

nativeint

帶正負號的原生整數,與 s 中所包含的數字相等。

實作

例外狀況

snull

style 不是 NumberStyles 值,或 style 不是 AllowHexSpecifierHexNumber 值的組合。

s 的格式不正確。

s 代表小於 MinValue 或大於 MaxValue 的數字。

適用於

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

將指定樣式和文化特性特定格式之數位字元表示的唯讀範圍,轉換為其帶正負號的原生整數對等專案。

public static IntPtr Parse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, IFormatProvider? provider = default);
static member Parse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider -> nativeint
Public Shared Function Parse (s As ReadOnlySpan(Of Char), Optional style As NumberStyles = System.Globalization.NumberStyles.Integer, Optional provider As IFormatProvider = Nothing) As IntPtr

參數

s
ReadOnlySpan<Char>

包含要轉換之數位的唯讀字元範圍。

style
NumberStyles

列舉值的位元組合,表示 s 中可以存在的樣式項目。

provider
IFormatProvider

物件,其提供關於 s 的特定文化特性格式資訊。

傳回

IntPtr

nativeint

帶正負號的原生整數,與 s 中所包含的數字相等。

實作

例外狀況

style 不是 NumberStyles 值,或 style 不是 AllowHexSpecifierHexNumber 值的組合。

s 的格式不正確。

s 代表小於 MinValue 或大於 MaxValue 的數字。

適用於

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Source:
IntPtr.cs
Source:
IntPtr.cs

將 UTF-8 字元的範圍剖析為值。

public static IntPtr Parse (ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, IFormatProvider? provider = default);
static member Parse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider -> nativeint
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte), Optional style As NumberStyles = System.Globalization.NumberStyles.Integer, Optional provider As IFormatProvider = Nothing) As IntPtr

參數

utf8Text
ReadOnlySpan<Byte>

要剖析的 UTF-8 字元範圍。

style
NumberStyles

數位樣式的位元組合,可以存在於 中 utf8Text

provider
IFormatProvider

提供關於 utf8Text 之特定文化特性格式資訊的物件。

傳回

IntPtr

nativeint

剖析 utf8Text 的結果。

實作

適用於

Parse(String, IFormatProvider)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

將指定特定文化特性 (Culture) 格式之數字的字串表示法轉換成其對等帶正負號的原生整數。

public:
 static IntPtr Parse(System::String ^ s, IFormatProvider ^ provider);
public:
 static IntPtr Parse(System::String ^ s, IFormatProvider ^ provider) = IParsable<IntPtr>::Parse;
public static IntPtr Parse (string s, IFormatProvider? provider);
static member Parse : string * IFormatProvider -> nativeint
Public Shared Function Parse (s As String, provider As IFormatProvider) As IntPtr

參數

s
String

字串,包含要轉換的數字。

provider
IFormatProvider

物件,其提供關於 s 的特定文化特性格式資訊。

傳回

IntPtr

nativeint

帶正負號的原生整數,與 s 中所包含的數字相等。

實作

例外狀況

snull

s 的格式不正確。

s 代表小於 MinValue 或大於 MaxValue 的數字。

適用於

Parse(String, NumberStyles)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

將指定樣式之數字的字串表示法轉換成其對等帶正負號的原生整數。

public:
 static IntPtr Parse(System::String ^ s, System::Globalization::NumberStyles style);
public static IntPtr Parse (string s, System.Globalization.NumberStyles style);
static member Parse : string * System.Globalization.NumberStyles -> nativeint
Public Shared Function Parse (s As String, style As NumberStyles) As IntPtr

參數

s
String

字串,包含要轉換的數字。

style
NumberStyles

列舉值的位元組合,表示 s 中可以存在的樣式項目。

傳回

IntPtr

nativeint

帶正負號的原生整數,與 s 中所包含的數字相等。

例外狀況

snull

style 不是 NumberStyles 值,或 style 不是 AllowHexSpecifierHexNumber 值的組合。

s 的格式不正確。

s 代表小於 MinValue 或大於 MaxValue 的數字。

適用於

Parse(ReadOnlySpan<Char>, IFormatProvider)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

將字元範圍剖析為值。

public:
 static IntPtr Parse(ReadOnlySpan<char> s, IFormatProvider ^ provider) = ISpanParsable<IntPtr>::Parse;
public static IntPtr Parse (ReadOnlySpan<char> s, IFormatProvider? provider);
static member Parse : ReadOnlySpan<char> * IFormatProvider -> nativeint
Public Shared Function Parse (s As ReadOnlySpan(Of Char), provider As IFormatProvider) As IntPtr

參數

s
ReadOnlySpan<Char>

要剖析的字元範圍。

provider
IFormatProvider

提供關於 s 之特定文化特性格式資訊的物件。

傳回

IntPtr

nativeint

剖析 s 的結果。

實作

適用於

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Source:
IntPtr.cs
Source:
IntPtr.cs

將 UTF-8 字元的範圍剖析為值。

public:
 static IntPtr Parse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider) = IUtf8SpanParsable<IntPtr>::Parse;
public static IntPtr Parse (ReadOnlySpan<byte> utf8Text, IFormatProvider? provider);
static member Parse : ReadOnlySpan<byte> * IFormatProvider -> nativeint
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider) As IntPtr

參數

utf8Text
ReadOnlySpan<Byte>

要剖析的 UTF-8 字元範圍。

provider
IFormatProvider

提供關於 utf8Text 之特定文化特性格式資訊的物件。

傳回

IntPtr

nativeint

剖析 utf8Text 的結果。

實作

適用於

Parse(String)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

將數字的字串表示轉換成其對等帶正負號的原生整數。

public:
 static IntPtr Parse(System::String ^ s);
public static IntPtr Parse (string s);
static member Parse : string -> nativeint
Public Shared Function Parse (s As String) As IntPtr

參數

s
String

字串,包含要轉換的數字。

傳回

IntPtr

nativeint

帶正負號的原生整數,與 s 中所包含的數字相等。

例外狀況

snull

s 的格式不正確。

s 代表小於 MinValue 或大於 MaxValue 的數字。

適用於