gpt4 book ai didi

c# - 如何在 C# 中比较亚洲(越南语/unicode)字符串?

转载 作者:行者123 更新时间:2023-11-30 20:18:56 30 4
gpt4 key购买 nike

<分区>

我有以下代码:

Thread.CurrentThread.CurrentCulture = new CultureInfo("vi-VN");

string a = "Biển Ðông";
string b = "Biển Đông";

if (a.Equals(b, StringComparison.CurrentCulture))
{
Console.WriteLine("Yes");
}

这两个字符串是相同的,但我总是得到 false使用 Equals 检查时.如果我将其添加到 HashSet<string> ,那么我将在容器中得到两件元素而不是一件元素。

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com