DateTimeOffset.TryParse 方法

定義

將日期和時間之指定的字串表示轉換為其對等的 DateTimeOffsetConverts a specified string representation of a date and time to its DateTimeOffset equivalent.

多載

TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset)

嘗試將日期和時間的指定字串表示轉換為其相等的 DateTimeOffset,並傳回表示轉換是否成功的值。Tries to convert a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

TryParse(ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles, DateTimeOffset)

嘗試將日期和時間的指定範圍表示轉換為其對等的 DateTimeOffset,並傳回值以指出轉換是否成功。Tries to convert a specified span representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

TryParse(String, DateTimeOffset)

嘗試將日期和時間之指定的字串表示轉換為其相等的 DateTimeOffset,並傳回一個值,指出轉換是否成功。Tries to converts a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

TryParse(ReadOnlySpan<Char>, DateTimeOffset)

嘗試將日期和時間的指定範圍表示轉換為其對等的 DateTimeOffset,並傳回值以指出轉換是否成功。Tries to convert a specified span representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset)

嘗試將日期和時間的指定字串表示轉換為其相等的 DateTimeOffset,並傳回表示轉換是否成功的值。Tries to convert a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

public:
 static bool TryParse(System::String ^ input, IFormatProvider ^ formatProvider, System::Globalization::DateTimeStyles styles, [Runtime::InteropServices::Out] DateTimeOffset % result);
public static bool TryParse (string input, IFormatProvider formatProvider, System.Globalization.DateTimeStyles styles, out DateTimeOffset result);
static member TryParse : string * IFormatProvider * System.Globalization.DateTimeStyles * DateTimeOffset -> bool
Public Shared Function TryParse (input As String, formatProvider As IFormatProvider, styles As DateTimeStyles, ByRef result As DateTimeOffset) As Boolean

參數

input
String

字串,包含要轉換的日期和時間。A string that contains a date and time to convert.

formatProvider
IFormatProvider

提供關於 input 之特定文化特性格式資訊的物件。An object that provides culture-specific formatting information about input.

styles
DateTimeStyles

列舉值的位元組合,其表示 input 所允許的格式。A bitwise combination of enumeration values that indicates the permitted format of input.

result
DateTimeOffset

如果轉換成功,方法傳回時內含的 DateTimeOffset 值就會和 input 的日期和時間相等,或者,如果轉換失敗,則為 MinValueWhen the method returns, contains the DateTimeOffset value equivalent to the date and time of input, if the conversion succeeded, or MinValue, if the conversion failed. 如果 input 參數為 null,或者不包含日期和時間的有效字串表示,則轉換會失敗。The conversion fails if the input parameter is null or does not contain a valid string representation of a date and time. 這個參數會以未初始化的狀態傳遞。This parameter is passed uninitialized.

傳回

如果 input 參數轉換成功,則為 true;否則為 falsetrue if the input parameter is successfully converted; otherwise, false.

例外狀況

styles 包含未定義的 DateTimeStyles 值。styles includes an undefined DateTimeStyles value.

-或--or- 不支援 NoCurrentDateDefaultNoCurrentDateDefault is not supported.

-或--or- styles 包含互斥的 DateTimeStyles 值。styles includes mutually exclusive DateTimeStyles values.

範例

下列範例會使用各種 DateTimeStyles 值來呼叫 TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) 方法,以剖析具有各種日期和時間格式的一些字串。The following example calls the TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) method with a variety of DateTimeStyles values to parse some strings with various date and time formats.

string dateString;
DateTimeOffset parsedDate;

dateString = "05/01/2008 6:00:00";
// Assume time is local 
if (DateTimeOffset.TryParse(dateString, null as IFormatProvider, 
                            DateTimeStyles.AssumeLocal, 
                            out parsedDate))
   Console.WriteLine("'{0}' was converted to {1}.", 
                     dateString, parsedDate.ToString());
else
   Console.WriteLine("Unable to parse '{0}'.", dateString);    

// Assume time is UTC
if (DateTimeOffset.TryParse(dateString, null as IFormatProvider, 
                            DateTimeStyles.AssumeUniversal, 
                            out parsedDate))
   Console.WriteLine("'{0}' was converted to {1}.", 
                     dateString, parsedDate.ToString());
else
   Console.WriteLine("Unable to parse '{0}'.", dateString);    

// Parse and convert to UTC 
dateString = "05/01/2008 6:00:00AM +5:00";
if (DateTimeOffset.TryParse(dateString, null as IFormatProvider, 
                           DateTimeStyles.AdjustToUniversal, 
                           out parsedDate))
   Console.WriteLine("'{0}' was converted to {1}.", 
                     dateString, parsedDate.ToString());
else
   Console.WriteLine("Unable to parse '{0}'.", dateString);    
// The example displays the following output to the console:
//    '05/01/2008 6:00:00' was converted to 5/1/2008 6:00:00 AM -07:00.
//    '05/01/2008 6:00:00' was converted to 5/1/2008 6:00:00 AM +00:00.
//    '05/01/2008 6:00:00AM +5:00' was converted to 5/1/2008 1:00:00 AM +00:00.      
Dim dateString As String
Dim parsedDate As DateTimeOffset

dateString = "05/01/2008 6:00:00"
' Assume time is local 
If DateTimeOffset.TryParse(dateString, Nothing, _
                           DateTimeStyles.AssumeLocal, _
                           parsedDate) Then
   Console.WriteLine("'{0}' was converted to {1}.", _
                     dateString, parsedDate.ToString())
Else
   Console.WriteLine("Unable to parse '{0}'.", dateString)    
End If

' Assume time is UTC
If DateTimeOffset.TryParse(dateString, Nothing, _
                           DateTimeStyles.AssumeUniversal, _
                           parsedDate) Then
   Console.WriteLine("'{0}' was converted to {1}.", _
                     dateString, parsedDate.ToString())
Else
   Console.WriteLine("Unable to parse '{0}'.", dateString)    
End If

' Parse and convert to UTC 
dateString = "05/01/2008 6:00:00AM +5:00"
If DateTimeOffset.TryParse(dateString, Nothing, _
                           DateTimeStyles.AdjustToUniversal, _
                           parsedDate) Then
   Console.WriteLine("'{0}' was converted to {1}.", _
                     dateString, parsedDate.ToString())
Else
   Console.WriteLine("Unable to parse '{0}'.", dateString)    
End If
' The example displays the following output to the console:
'    '05/01/2008 6:00:00' was converted to 5/1/2008 6:00:00 AM -07:00.
'    '05/01/2008 6:00:00' was converted to 5/1/2008 6:00:00 AM +00:00.
'    '05/01/2008 6:00:00AM +5:00' was converted to 5/1/2008 1:00:00 AM +00:00.      

備註

TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) 方法的這個多載就像 DateTimeOffset.Parse(String, IFormatProvider, DateTimeStyles) 方法,不同的是,如果轉換失敗,則不會擲回例外狀況。This overload of the TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) method is like the DateTimeOffset.Parse(String, IFormatProvider, DateTimeStyles) method, except that it does not throw an exception if the conversion fails. 方法會剖析字串,其中包含三個可依任何順序出現並以空白字元分隔的元素。The method parses a string with three elements that can appear in any order and are delimited by white space. 下表顯示這三個元素。These three elements are shown in the following table.

項目Element 範例Example
<日期 ><Date> "2/10/2007""2/10/2007"
<時間 ><Time> "1:02:03 PM""1:02:03 PM"
<位移 ><Offset> "-7:30""-7:30"

雖然每個元素都是選擇性的,但 <Offset > 不能單獨出現。Although each of these elements is optional, <Offset> cannot appear by itself. 它必須與 <日期 > 或 <時間 > 一起提供。It must be provided together with either <Date> or <Time>. 如果 <日期 > 遺失,其預設值為當天。If <Date> is missing, its default value is the current day. 如果 <日期 > 存在,但其年份元件只包含兩位數,則會根據 Calendar.TwoDigitYearMax 屬性的值,將它轉換成 provider 參數目前行事曆中的年份。If <Date> is present but its year component consists of only two digits, it is converted to a year in the provider parameter's current calendar based on the value of the Calendar.TwoDigitYearMax property. 如果 <時間 > 遺失,其預設值為 12:00:00 AM。If <Time> is missing, its default value is 12:00:00 AM. 如果遺漏 <Offset >,則其預設值為本地時區的位移,如果 DateTimeStyles.AdjustToUniversalDateTimeStyles.AssumeUniversal 值在 styles中指定,則為 ZeroIf <Offset> is missing, its default value is the offset of the local time zone, or Zero if either the DateTimeStyles.AdjustToUniversal or DateTimeStyles.AssumeUniversal value is specified in styles. 如果 <Offset > 存在,它可以代表與國際標準時間(UTC)之間的負數或正位移。If <Offset> is present, it can represent either a negative or a positive offset from Coordinated Universal Time (UTC). 不論是哪一種情況,<Offset > 都必須包含正負號符號,否則方法會傳回 falseIn either case, <Offset> must include a sign symbol or the method returns false.

input 字串會使用 formatProvider 參數所提供之 DateTimeFormatInfo 物件中的特定文化特性格式資訊進行剖析。The input string is parsed by using the culture-specific formatting information in a DateTimeFormatInfo object supplied by the formatProvider parameter. formatProvider 參數可以是下列其中一項:The formatProvider parameter can be either of the following:

此外,每個元素都可以用前置或尾端空白字元分隔,而 <日期 > 和 <時間 > 元件可以包含內部空白字元(例如 6: 00:00)。In addition, each element can be delimited by leading or trailing white space, and the <Date> and <Time> components can include inner white space (such as 6: 00:00). 只有 > 元件的 <位移不能包含內部空白字元。Only the <Offset> component cannot include inner white space.

如果 null``provider,則會使用對應至目前文化特性的 CultureInfo 物件。If provider is null, the CultureInfo object that corresponds to the current culture is used.

<Offset > 中使用的正或負號,必須是 + 或-。The positive or negative sign used in <Offset> must be either + or -. 它不是由 formatprovider 參數之 NumberFormat 屬性所傳回 NumberFormatInfo 物件的 PositiveSignNegativeSign 屬性所定義。It is not defined by the PositiveSign or NegativeSign properties of the NumberFormatInfo object returned by the formatprovider parameter's NumberFormat property.

以下是支援 DateTimeStyles 列舉的成員:The following members of the DateTimeStyles enumeration are supported:

DateTimeStyles 成員DateTimeStyles Member 註解Comments
AdjustToUniversal 剖析 input 所表示的字串,並在必要時,將它轉換為 UTC。Parses the string represented by input and, if necessary, converts it to UTC. 它相當於剖析字串,然後呼叫傳回物件的 ToUniversalTime() 方法。It is equivalent to parsing a string, and then calling the returned object's ToUniversalTime() method.
AllowInnerWhite 雖然有效,但會忽略這個值。Although valid, this value is ignored. <日期 > 和 <時間 > 元件中允許內部空白字元。Inner white space is allowed in the <Date> and <Time> components.
AllowLeadingWhite 雖然有效,但會忽略這個值。Although valid, this value is ignored. 在剖析的字串中,每個元件的前面都允許前置空白字元。Leading white space is allowed in front of each component in the parsed string.
AllowTrailingWhite 雖然有效,但會忽略這個值。Although valid, this value is ignored. 剖析字串中的每個元件前面都允許尾端空白字元。Trailing white space is allowed in front of each component in the parsed string.
AllowWhiteSpaces 這是預設行為。This is the default behavior. 您無法藉由提供更嚴格的 DateTimeStyles 列舉值(例如 DateTimeStyles.None)來覆寫它。It cannot be overridden by supplying a more restrictive DateTimeStyles enumeration value, such as DateTimeStyles.None.
AssumeLocal 表示,如果 input 參數缺少 <位移 > 元素,則應提供當地時區的位移。Indicates that, if the input parameter lacks an <Offset> element, the offset of the local time zone should be provided. 這是 TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) 方法的預設行為。This is the default behavior of the TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) method.
AssumeUniversal 表示,如果 input 參數缺少 <位移 > 元素,則應提供 UTC 位移(00:00)。Indicates that, if the input parameter lacks an <Offset> element, the UTC offset (00:00) should be provided.
None 雖然有效,但會忽略此值且不會有任何作用。Although valid, this value is ignored and has no effect.
RoundtripKind 因為 DateTimeOffset 結構不包含 Kind 屬性,所以這個值沒有任何作用。Because the DateTimeOffset structure does not include a Kind property, this value has no effect.

僅不支援 DateTimeStyles.NoCurrentDateDefault 值。Only the DateTimeStyles.NoCurrentDateDefault value is not supported. 如果此值包含在 styles 參數中,則會擲回 ArgumentExceptionAn ArgumentException is thrown if this value is included in the styles parameter.

另請參閱

TryParse(ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles, DateTimeOffset)

嘗試將日期和時間的指定範圍表示轉換為其對等的 DateTimeOffset,並傳回值以指出轉換是否成功。Tries to convert a specified span representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

public:
 static bool TryParse(ReadOnlySpan<char> input, IFormatProvider ^ formatProvider, System::Globalization::DateTimeStyles styles, [Runtime::InteropServices::Out] DateTimeOffset % result);
public static bool TryParse (ReadOnlySpan<char> input, IFormatProvider formatProvider, System.Globalization.DateTimeStyles styles, out DateTimeOffset result);
static member TryParse : ReadOnlySpan<char> * IFormatProvider * System.Globalization.DateTimeStyles * DateTimeOffset -> bool
Public Shared Function TryParse (input As ReadOnlySpan(Of Char), formatProvider As IFormatProvider, styles As DateTimeStyles, ByRef result As DateTimeOffset) As Boolean

參數

input
ReadOnlySpan<Char>

包含字元的範圍,其表示要轉換的日期和時間。A span containing the characters representing the date and time to convert.

formatProvider
IFormatProvider

提供關於 input 之特定文化特性格式資訊的物件。An object that provides culture-specific formatting information about input.

styles
DateTimeStyles

列舉值的位元組合,其表示 input 所允許的格式。A bitwise combination of enumeration values that indicates the permitted format of input.

result
DateTimeOffset

如果轉換成功,方法傳回時內含的 DateTimeOffset 值就會和 input 的日期和時間相等,或者,如果轉換失敗,則為 MinValueWhen the method returns, contains the DateTimeOffset value equivalent to the date and time of input, if the conversion succeeded, or MinValue, if the conversion failed. 如果 input 參數為 null,或者不包含日期和時間的有效字串表示,則轉換會失敗。The conversion fails if the input parameter is null or does not contain a valid string representation of a date and time. 這個參數會以未初始化的狀態傳遞。This parameter is passed uninitialized.

傳回

如果 input 參數轉換成功,則為 true;否則為 falsetrue if the input parameter is successfully converted; otherwise, false.

TryParse(String, DateTimeOffset)

嘗試將日期和時間之指定的字串表示轉換為其相等的 DateTimeOffset,並傳回一個值,指出轉換是否成功。Tries to converts a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

public:
 static bool TryParse(System::String ^ input, [Runtime::InteropServices::Out] DateTimeOffset % result);
public static bool TryParse (string input, out DateTimeOffset result);
static member TryParse : string * DateTimeOffset -> bool
Public Shared Function TryParse (input As String, ByRef result As DateTimeOffset) As Boolean

參數

input
String

字串,包含要轉換的日期和時間。A string that contains a date and time to convert.

result
DateTimeOffset

如果轉換成功,方法傳回時內含的 DateTimeOffset 就會和 input 的日期和時間相等;如果轉換失敗,則為 MinValueWhen the method returns, contains the DateTimeOffset equivalent to the date and time of input, if the conversion succeeded, or MinValue, if the conversion failed. 如果 input 參數為 null,或者不包含日期和時間的有效字串表示,則轉換會失敗。The conversion fails if the input parameter is null or does not contain a valid string representation of a date and time. 這個參數會以未初始化的狀態傳遞。This parameter is passed uninitialized.

傳回

如果 input 參數轉換成功,則為 true;否則為 falsetrue if the input parameter is successfully converted; otherwise, false.

範例

下列範例會呼叫 TryParse(String, DateTimeOffset) 方法,以使用各種日期和時間格式來剖析數個字串。The following example calls the TryParse(String, DateTimeOffset) method to parse several strings with various date and time formats.

DateTimeOffset parsedDate;
string dateString;

// String with date only
dateString = "05/01/2008";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
   Console.WriteLine("{0} was converted to {1}.", 
                     dateString, parsedDate);

// String with time only
dateString = "11:36 PM";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
   Console.WriteLine("{0} was converted to {1}.", 
                     dateString, parsedDate);

// String with date and offset 
dateString = "05/01/2008 +7:00";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
   Console.WriteLine("{0} was converted to {1}.", 
                     dateString, parsedDate);

// String with day abbreviation
dateString = "Thu May 01, 2008";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
   Console.WriteLine("{0} was converted to {1}.", 
                     dateString, parsedDate);

// String with date, time with AM/PM designator, and offset
dateString = "5/1/2008 10:00 AM -07:00";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
   Console.WriteLine("{0} was converted to {1}.", 
                     dateString, parsedDate);
// if (run on 3/29/07, the example displays the following output
// to the console:
//    05/01/2008 was converted to 5/1/2008 12:00:00 AM -07:00.
//    11:36 PM was converted to 3/29/2007 11:36:00 PM -07:00.
//    05/01/2008 +7:00 was converted to 5/1/2008 12:00:00 AM +07:00.
//    Thu May 01, 2008 was converted to 5/1/2008 12:00:00 AM -07:00.
//    5/1/2008 10:00 AM -07:00 was converted to 5/1/2008 10:00:00 AM -07:00.                                 
Dim parsedDate As DateTimeOffset
Dim dateString As String

' String with date only
dateString = "05/01/2008"
If DateTimeOffset.TryParse(dateString, parsedDate) Then _
   Console.WriteLine("{0} was converted to {1}.", _
                     dateString, parsedDate)

' String with time only
dateString = "11:36 PM"
If DateTimeOffset.TryParse(dateString, parsedDate) Then _
   Console.WriteLine("{0} was converted to {1}.", _
                     dateString, parsedDate)

' String with date and offset 
dateString = "05/01/2008 +7:00"
If DateTimeOffset.TryParse(dateString, parsedDate) Then _
   Console.WriteLine("{0} was converted to {1}.", _
                     dateString, parsedDate)

' String with day abbreviation
dateString = "Thu May 01, 2008"
If DateTimeOffset.TryParse(dateString, parsedDate) Then _
   Console.WriteLine("{0} was converted to {1}.", _
                     dateString, parsedDate)

' String with date, time with AM/PM designator, and offset
dateString = "5/1/2008 10:00 AM -07:00"
If DateTimeOffset.TryParse(dateString, parsedDate) Then _
   Console.WriteLine("{0} was converted to {1}.", _
                     dateString, parsedDate)
' If run on 3/29/07, the example displays the following output
' to the console:
'    05/01/2008 was converted to 5/1/2008 12:00:00 AM -07:00.
'    11:36 PM was converted to 3/29/2007 11:36:00 PM -07:00.
'    05/01/2008 +7:00 was converted to 5/1/2008 12:00:00 AM +07:00.
'    Thu May 01, 2008 was converted to 5/1/2008 12:00:00 AM -07:00.
'    5/1/2008 10:00 AM -07:00 was converted to 5/1/2008 10:00:00 AM -07:00.                                 

備註

TryParse(String, DateTimeOffset) 方法的這個多載就像 DateTimeOffset.Parse(String) 方法,不同的是,如果轉換失敗,則不會擲回例外狀況。This overload of the TryParse(String, DateTimeOffset) method is like the DateTimeOffset.Parse(String) method, except that it does not throw an exception if the conversion fails. 它會剖析字串,其中包含三個可依任何順序出現並以空白字元分隔的元素。It parses a string with three elements that can appear in any order and are delimited by white space. 下表顯示這三個元素。These three elements are shown in the following table.

項目Element 範例Example
<日期 ><Date> "2/10/2007""2/10/2007"
<時間 ><Time> "1:02:03 PM""1:02:03 PM"
<位移 ><Offset> "-7:30""-7:30"

雖然每個元素都是選擇性的,但 <Offset > 不能單獨出現。Although each of these elements is optional, <Offset> cannot appear by itself. 它必須與 <日期 > 或 <時間 > 一起提供。It must be provided together with either <Date> or <Time>. 如果 <日期 > 遺失,其預設值為當天。If <Date> is missing, its default value is the current day. 如果 <日期 > 存在,但其年份元件只包含兩位數,則會根據 Calendar.TwoDigitYearMax 屬性的值,將它轉換成目前文化特性目前行事曆中的年份。If <Date> is present but its year component consists of only two digits, it is converted to a year in the current culture's current calendar based on the value of the Calendar.TwoDigitYearMax property. 如果 <時間 > 遺失,其預設值為 12:00:00 AM。If <Time> is missing, its default value is 12:00:00 AM. 如果遺漏 <Offset >,其預設值就是本地時區的位移。If <Offset> is missing, its default value is the offset of the local time zone. 如果 <Offset > 存在,它可以代表與國際標準時間(UTC)之間的負數或正位移。If <Offset> is present, it can represent either a negative or a positive offset from Coordinated Universal Time (UTC). 不論是哪一種情況,<Offset > 都必須包含正負號符號,否則方法會傳回 falseIn either case, <Offset> must include a sign symbol or the method returns false.

input 字串會使用針對目前文化特性初始化的 DateTimeFormatInfo 物件中的格式資訊進行剖析。The input string is parsed by using the formatting information in a DateTimeFormatInfo object initialized for the current culture. 若要剖析包含不一定會對應到目前文化特性之指定格式的字串,請使用 TryParseExact 方法,並提供格式規範。To parse a string that contains designated formatting that does not necessarily correspond to that of the current culture, use the TryParseExact method and provide a format specifier.

另請參閱

TryParse(ReadOnlySpan<Char>, DateTimeOffset)

嘗試將日期和時間的指定範圍表示轉換為其對等的 DateTimeOffset,並傳回值以指出轉換是否成功。Tries to convert a specified span representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.

public:
 static bool TryParse(ReadOnlySpan<char> input, [Runtime::InteropServices::Out] DateTimeOffset % result);
public static bool TryParse (ReadOnlySpan<char> input, out DateTimeOffset result);
static member TryParse : ReadOnlySpan<char> * DateTimeOffset -> bool
Public Shared Function TryParse (input As ReadOnlySpan(Of Char), ByRef result As DateTimeOffset) As Boolean

參數

input
ReadOnlySpan<Char>

範圍,其包含表示所要轉換日期和時間的字元。A span containing the characters representing the date and time to convert.

result
DateTimeOffset

如果轉換成功,方法傳回時內含的 DateTimeOffset 就會和 input 的日期和時間相等;如果轉換失敗,則為 MinValueWhen the method returns, contains the DateTimeOffset equivalent to the date and time of input, if the conversion succeeded, or MinValue, if the conversion failed. 如果 input 參數為 null,或者不包含日期和時間的有效字串表示,則轉換會失敗。The conversion fails if the input parameter is null or does not contain a valid string representation of a date and time. 這個參數會以未初始化的狀態傳遞。This parameter is passed uninitialized.

傳回

如果 input 參數轉換成功,則為 true;否則為 falsetrue if the input parameter is successfully converted; otherwise, false.

適用於