여기서 내가 뭘 잘못하고 있니? 나는 사용자 이름을 출력으로 propercase로 표시하고 싶지만 그것을 이해할 수는 없다.올바른 케이스 제목 케이스 질문
string proper = this.xTripNameTextBox.Text;
CultureInfo properCase = System.Threading.Thread.CurrentThread.CurrentCulture;
TextInfo currentInfo = properCase.TextInfo;
proper = currentInfo.ToTitleCase(proper);
this.xTripOutputLabel.Text = proper + Environment.NewLine + "The total gallons you would use: " + Output.ToString("0") + Environment.NewLine + "Total amount it will cost you: " + Coutput.ToString("C") + Environment.NewLine +" Your customer number is " + rnd1.Next(1, 1000).ToString();
당신이 얻고있는 것과 기대하는 것을 우리에게 보여줄 수 있습니까? –
사용자가 "John DOE"를 입력하면 "John Doe"라는 문자를 대문자 "John Doe"로 변환해야합니다. 그러나 내가 잘못한 것을 알지 못합니다. –
문제는 ToLower를 사용하여 먼저 문자열을 변환합니다. 소문자로 설정하면 제목 케이스가 작동합니다. –