Hello everyone,
in the book that i am using to learn c# and how to programm, i have to build this little application, what it does is quite obvious, it replace the "r" by "w" in all of the sentence. When i ran the app, i noticed that the capital R were not replaced (i understand, r and R are not the samething so, i added the line:
sentence = sentence.Replace("R", "W");
So what i would like to know is:
Is there another way to do it without the extra line ?
static void Main(string[] args)
{
string sentence;
Console.Write("Type a sentence ");
sentence = Console.ReadLine();
Console.WriteLine("");
sentence = sentence.Replace("R", "W");
Console.WriteLine(sentence.Replace("r", "w"));
Console.ReadLine();