gpt4 book ai didi

c# - convert.ToString(C0) 的行为如何?

转载 作者:行者123 更新时间:2023-11-30 16:53:51 33 4
gpt4 key购买 nike

我有不同的场景。我需要输出,其中值必须以 ₹ 格式返回逗号分隔值,它在我的系统中执行,其中我有 ₹ 卢比符号。而在用户系统中,C0 以逗号分隔值返回 $ 值,我不知道他的系统中是否有 ₹ 符号。任何人都可以建议。

附言。我在主题行中使用了无法使用更多功能的表达式。我使用过 convert.ToString("C0")。

最佳答案

您可以暴力搜索字符串中的任何货币符号,并将它们更改为您想要的任何字符,例如:

string s = "$";
foreach (var c in s)
{
var category = CharUnicodeInfo.GetUnicodeCategory(c);

if (category == UnicodeCategory.CurrencySymbol)
{
//Force convert the char to what every character you want
}
}

关于c# - convert.ToString(C0) 的行为如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30993633/

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