How to make the text in quotes replace uppercase?

static void Main() { string path = @"D:\GITHUB\C#\222.txt"; string s = File.ReadAllText(path); bool toUp = false; var sb = new StringBuilder(); foreach(var c in path) { if(c == '\"') { toUp = !toUp; continue; } sb.Append(toUp ? char.ToUpper(c) : c); } string appendText = s; File.WriteAllText(path, s); } 
  • one
    What does not suit path.ToUpper() ? - Alexey Shimansky
  • if you replace it with path.ToUpper() it starts swearing for an error - Imp3l
  • Well, fix it .. - Alexey Shimansky
  • I would have known how ... - Imp3l
  • one
    Sorry, did you write this code yourself? Do you understand why you need StringBuilder ? You wrote the text in it, and what do you do with it next? - VladD

0