private string rightCase(string goofyStr) { CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; return textInfo.ToTitleCase(goofyStr); }
return string.Format("{0},{1},{2},", rightCase(category), rightCase(film), rightCase(actor));
Quote TextInfo.ToTitleCase[^]:The ToTitleCase method provides an arbitrary casing behavior which is not necessarily linguistically correct. A linguistically correct solution would require additional rules, and the current algorithm is somewhat simpler and faster. We reserve the right to make this API slower in the future.
private string TitleCase(string goofyStr) { TextInfo textInfo = new CultureInfo("en-US",false).TextInfo; return textInfo.ToTitleCase( goofyStr); }
// Creates a TextInfo based on the "en-US" culture. private string rightCase(string goofyStr) { TextInfo myTI = new CultureInfo("en-US",false).TextInfo; return myTI.ToTitleCase(goofyStr); }
CultureInfo.CurrentCulture.TextInfo.ToTitleCase("ARGO")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)