Ошибка в работе с StringBuilder - строка не меняется - C#
Формулировка задачи:
Строка не меняется...
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication9
- {
- class Program
- {
- static void Main(string[] args)
- {
- StringBuilder b = new StringBuilder();
- b.Append(Console.ReadLine());
- //string s = Console.ReadLine();
- if (char.IsLower(b[1])) char.ToUpper(b[1]);
- Console.WriteLine(b); //
- Console.ReadLine();
- }
- }
- }
Решение задачи: «Ошибка в работе с StringBuilder - строка не меняется»
textual
Листинг программы
- StringBuilder b = new StringBuilder();
- b.Append(Console.ReadLine());
- //string s = Console.ReadLine();
- if (char.IsLower(b[1])) b[1] = char.ToUpper(b[1]);
- Console.WriteLine(b);
- Console.ReadLine();
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д