Ashok Padmanabhan
Ashok Padmanabhan

Reputation: 2120

Is ToTitleCase supposed to capitalize letters after the apostrophe?

I have searched but not found an answer. I have this as an extension method:

 <Extension()> _
   Public Function ChangeCase(ByVal source As String) As String
      Return New System.Globalization.CultureInfo("en-US").TextInfo.ToTitleCase(source)
  End Function

But it is capitalizing the letter after the apostrophe. Is it supposed to do that? For example I'll becomes I'Ll. It also capitalizes letters after numbers such 1930s becomes1930S

Upvotes: 1

Views: 501

Answers (1)

Blackwood
Blackwood

Reputation: 4534

The documentation at https://msdn.microsoft.com/en-us/library/system.globalization.textinfo.totitlecase(v=vs.110).aspx includes an example that shows capitalisation after an apostrophe. It also states in the remarks that the it has "arbitrary casing behavior which is not necessarily linguistically correct". Your answer is that the behaviour is what it is and Microsoft doesn't claim it is perfect.

Upvotes: 2

Related Questions