I am trying to convert a string to title case in my cross platform Xamarin app using the following code.
string rawString = "this is a test string";
System.Globalization.TextInfo textInfo = CultureInfo.CurrentCulture.TextInfo;
string formattedString = textInfo.ToTitleCase(rawString);
//Expected output is "This Is A Test String"
I cannot run this code as the compiler insists that there is no definition for ToTitleCase in TextInfo. However the documentation says otherwise.
I am using Visual Studio 2017 with the latest NuGet packages for everything (including all .Net packages and Xamarin.Forms)