guid是否包含特殊字符? [英] Does guid contains special character?
本文介绍了guid是否包含特殊字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用System.Guid.NewGuid()来创建新的唯一标识符。
它是否包含任何特殊字符,如'_'(下划线)?
提前致谢,
Pushkar
我尝试过:
I am using System.Guid.NewGuid() to create new unique identifier.
Does it contains any special character like '_' (underscore)?
Thanks in advance,
Pushkar
What I have tried:
int randomNumber = System.Guid.NewGuid();
是否有可能包含_(下划线) 。
Is there any possibility that it will contain "_"(underscore).
推荐答案
不,它没有下划线。如果你正在处理guid作为字符串,你可以添加各种参数到Guid.ToString来控制是否使用了连字符或花括号。
Guid.ToString方法(字符串)(系统) [ ^ ]
No it won't have an underscore. If you are processing a guid as a string there are various parameters you can add to Guid.ToString to control if the hyphen or curly braces are used.
Guid.ToString Method (String) (System)[^]
是的,Guid中的一个字节可以在#0~#255之间有任何值。 Guid的字符串表示实际上是一个单独的问题。
Guid是#16字节,#128位整数。
看看:
Yes, a byte in a Guid could have any value between #0~#255. The string representation of a Guid is really a separate issue.
A Guid is a #16-byte, #128-bit integer.
Take a look:
Guid newGuid = Guid.NewGuid();
Byte[] bytes = newGuid.ToByteArray();
// set break-point here, examine bytes
建议阅读:[ ^ ]
这篇关于guid是否包含特殊字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文