Guid.ToString Method
Guid.ToString Method
Returns a string representation of the value of this instance of the Guid structure.
ToString(String)
Returns a string representation of the value of this Guid instance, according to the provided format specifier.
public string ToString (string format);
Parameters
- format
- String
A single format specifier that indicates how to format the value of this Guid. The format
parameter can be "N", "D", "B", "P", or "X". If format
is null
or an empty string (""), "D" is used.
Returns
The value of this Guid, represented as a series of lowercase hexadecimal digits in the specified format.
Exceptions
The value of format
is not null
, an empty string (""), "N", "D", "B", "P", or "X".
Remarks
The following table shows the accepted format specifiers for the format
parameter. "0" represents a digit; hyphens ("-"), braces ("{", "}"), and parentheses ("(", ")") appear as shown.
Specifier | Format of return value |
---|---|
N |
32 digits: 00000000000000000000000000000000 |
D |
32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 |
B |
32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000} |
P |
32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000) |
X |
Four hexadecimal values enclosed in braces, where the fourth value
is a subset of eight hexadecimal values that is also enclosed in braces: {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} |
The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the String.ToUpper method on the returned string.
相关文章
- 我为Dexposed续一秒——论ART上运行时 Method AOP实现
- Summary: How to calculate PI? Based on Monte Carlo method
- FormsAuthentication.Decrypt(String) Method 在.net内部的调用
- DataSet.Clear Method ()
- 利用反射快速给Model实体赋值 使用 Task 简化异步编程 Guid ToString 格式知多少?(GUID 格式) Parallel Programming-实现并行操作的流水线(生产者、消费者) c# 无损高质量压缩图片代码 8种主要排序算法的C#实现 (一) 8种主要排序算法的C#实现 (二)
- IIS7.5上的REST服务的Put操作发生HTTP Error 405.0 - Method Not Allowed 解决方法
- uthentication to host '10.0.1.33' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'PCName' (using password: YES)
- 第三十四章 SQL命令 DROP METHOD
- Python: make function to be a bounded method
- 用最简单的例子理解模板方法模式(Template Method Pattern)
- Method Swizzling 为什么要先调用 class_addMethod?
- C# linq to entity中字段转化为指定类型 lambda 字段类型转换 解决"LINQ to Entities does not recognize the method 'System.String ToString(Int32)' method, and this method cannot be translated into a store expression."
- 【JAVA基础】不同的jar拥有相同全限定类名和不同的方法Method时NoSuchMethodError,同名类加载问题 / 双亲委派
- intelj idea编译项目报错,Error:ajc: The method getDestHost() is undefined