Visual C 中的标题大小写

发布于 2024-08-08 13:19:28 字数 461 浏览 3 评论 0原文

我目前正在尝试找到一种将 Visual(托管)C++ 字符串转换为标题大小写的简单方法。 在 VB.NET 中,您可以使用:

StrConv(sampleString, vbProperCase)

sampleString = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(sampleString)

在 C# 中,您可以使用:

sampleString = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(sampleString)

如何在 Visual C++ 中执行此操作?是否有类似的东西我似乎找不到?

I'm currently trying to find an easy way to convert a Visual (Managed) C++ string to title case.
In VB.NET, you can use either:

StrConv(sampleString, vbProperCase)

or

sampleString = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(sampleString)

In C# you use:

sampleString = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(sampleString)

How do I do it in Visual C++? Is it something similar that I just can't seem to find?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

缺⑴份安定 2024-08-15 13:19:28

检查 TextInfo.ToTitleCase 上的文档有托管 C++ 的示例

Check the documentation on TextInfo.ToTitleCase it has examples for Managed C++

权谋诡计 2024-08-15 13:19:28

如果您谈论的是托管 C++,您可以使用与 C#/VB.Net 中相同的函数。

如果您指的是本机 C++,那么:

  1. 可以肯定该语言本身不存在此类内容。
  2. AFAIK 也不在 Win32 API 中。
  3. 那么你最好的希望就是在某个库中找到这样的函数(我个人想不出一个)。

If you're talking about managed C++, you can use the same functions as in C#/VB.Net.

If you mean native C++, then:

  1. Pretty certain there's nothing of the sort in the language itself.
  2. AFAIK not in the Win32 API as well.
  3. Your best hope then is to find such a function in some library (I personally can't think of one).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文