Bug 16365 - TextInfo.ToTitleCase() differs from .Net implementation
Summary: TextInfo.ToTitleCase() differs from .Net implementation
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2013-11-20 13:00 UTC by Steve Bjorg
Modified: 2013-11-29 14:41 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Steve Bjorg 2013-11-20 13:00:58 UTC
String.ToCamelCase("this_is_a_string") yields different results in Mono.

In Mono String.ToCamelCase("this_is_a_string") yields this as a result:

Whereas in Visual Studio 2010 String.ToCamelCase("this_is_a_string") yields this as a result:

The difference is that Mono only capitalizes the initial "T" and doesn't recognize the _ (underscore) as a word separator.
Comment 1 Mikayla Hutchinson [MSFT] 2013-11-20 13:40:06 UTC
What is String.ToCamelCase? It's not a member of System.String.
Comment 2 Steve Bjorg 2013-11-20 13:51:13 UTC
My bad, that's how we aliased it internally.  It's ToTitleCase()
Comment 3 Steve Bjorg 2013-11-20 13:52:58 UTC
My bad, that's how we aliased it internally.  It's TextInfo.ToTitleCase() and we use the InvariantCulture for all string conversions.


string ToCamelCase(this string text) {
    return CultureInfo.InvariantCulture.TextInfo.ToTitleCase(text);

Sorry for the confusion.
Comment 4 Mikayla Hutchinson [MSFT] 2013-11-20 15:21:21 UTC
Comment 5 Marek Safar 2013-11-29 14:41:12 UTC
Fixed in master