Guid.IFormattable.ToString(String, IFormatProvider) Guid.IFormattable.ToString(String, IFormatProvider) Guid.IFormattable.ToString(String, IFormatProvider) Method

定义

根据所提供的格式说明符和区域性特定的格式信息,返回此实例值的字符串表示形式。Returns a string representation of the value of this instance, according to the provided format specifier and culture-specific format information.

 virtual System::String ^ System.IFormattable.ToString(System::String ^ format, IFormatProvider ^ provider) = IFormattable::ToString;
string IFormattable.ToString (string format, IFormatProvider provider);
Function ToString (format As String, provider As IFormatProvider) As String Implements IFormattable.ToString

参数

format
String String String

一个单格式说明符,它指示如何格式化此 Guid 的值。A single format specifier that indicates how to format the value of the Guid. format 参数可以是“N”、“D”、“B”、“P”或“X”。The format parameter can be "N", "D", "B", "P", or "X". 如果 format为 NULL 或空字符串 (""),则使用“D”。If format is null or an empty string (""), "D" is used.

返回

Guid 的值,用一系列指定格式的小写十六进制位表示。The value of this Guid represented as a series of lowercase hexadecimal digits in the specified format.

实现

异常

format 的值不是 NULL,一个空字符串 (""),或者下列格式说明符之一:“N”、“D”、“B”、“P”或“X”。The value of format is not null, an empty string (""), or one of the following single format specifiers:"N", "D", "B", "P", or "X".

适用于