c# - C#中的Unicode字符串

标签 c# unicode-string

我记得在 C++ 中使用 Unicode 字符串是这样的:

std::wstring str = _T("a string here");

C# 中的等价物是什么?

最佳答案

C# 中的等价物是 String 类。

根据 MSDN :

(A String) Represents text as a series of Unicode characters.

[...] Each code point is encoded using UTF-16 encoding

所以,如果你执行 string str = "a string here";,你就有了一个 Unicode 字符串。

关于c# - C#中的Unicode字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13277958/

相关文章:

c# - 求解方程从3个点找到圆心

c# - 在 C# 中清理用户输入 - 最干净的方法?

c# - 带参数的开放泛型的依赖注入(inject)

java - 在 Java 中将字符串转换为小型大写字母伪字母

unicode - 通过 FTP 将 ANSI 字符串写入 Unicode 文件

python - 从文本中删除所有表情符号

c# - 更新图表中的 y 轴最大值

c# - 当我从 ASP.NET Core 1.x 升级到 2.0 时,Identity CookieOptions 的替代品是什么?

ios - 从现有的 NSString 构建 unicode 字符串

c++ - c++构造函数/typedef的扩展