jouri
jouri
CC#
Created by jouri on 6/30/2023 in #help
❔ How do you recommend going about learning how to code.
thank you for the advice guys :D
11 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
Thank you so much for your help @jimmacle I appreciate it a lot.
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
ah alright, I thought the parentheses were pushed back a bit because of the .Equals. my bad lol
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
if correct.Equals("yes", StringComparison.InvariantCultureIgnoreCase)
{
Console.WriteLine("Great :D");
Console.ReadLine();
return;
}
if correct.Equals("no", StringComparison.InvariantCultureIgnoreCase)
{
Console.Write("Do you want to try again?");
string fail = Console.ReadLine();
if correct.Equals("yes", StringComparison.InvariantCultureIgnoreCase)
{
continue;
}
if (fail == "NO")
{
Console.WriteLine("why would u do that bro");
Console.ReadLine();
return;
if correct.Equals("yes", StringComparison.InvariantCultureIgnoreCase)
{
Console.WriteLine("Great :D");
Console.ReadLine();
return;
}
if correct.Equals("no", StringComparison.InvariantCultureIgnoreCase)
{
Console.Write("Do you want to try again?");
string fail = Console.ReadLine();
if correct.Equals("yes", StringComparison.InvariantCultureIgnoreCase)
{
continue;
}
if (fail == "NO")
{
Console.WriteLine("why would u do that bro");
Console.ReadLine();
return;
so now I have this, but it doesn't work. Also I think I might be far too new to understand most of this, but it helped a bit so thanks. :D
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
namespace console
{
internal class Program
{
public static void Main(string[] args)
{
while (true) {

Console.Write("Enter your name:");
string name = Console.ReadLine();
Console.Write("Enter your age:");
string age = Console.ReadLine();
Console.Write("Hello " + name + " you are " + age + ". is this correct:");
string correct = Console.ReadLine();

if (correct == "YES")
{
Console.WriteLine("Great :D");
Console.ReadLine();
return;
}
if (correct == "NO")
{
Console.Write("Do you want to try again?");
string fail = Console.ReadLine();
if (fail == "YES")
{
continue;
}
if (fail == "NO")
{
Console.WriteLine("why would u do that bro");
Console.ReadLine();
return;
}
}
}
}
}
}
namespace console
{
internal class Program
{
public static void Main(string[] args)
{
while (true) {

Console.Write("Enter your name:");
string name = Console.ReadLine();
Console.Write("Enter your age:");
string age = Console.ReadLine();
Console.Write("Hello " + name + " you are " + age + ". is this correct:");
string correct = Console.ReadLine();

if (correct == "YES")
{
Console.WriteLine("Great :D");
Console.ReadLine();
return;
}
if (correct == "NO")
{
Console.Write("Do you want to try again?");
string fail = Console.ReadLine();
if (fail == "YES")
{
continue;
}
if (fail == "NO")
{
Console.WriteLine("why would u do that bro");
Console.ReadLine();
return;
}
}
}
}
}
}
this is the full code.
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
alright hold on
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
what's a code block
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
just incase it causes confusion
22 replies
CC#
Created by jouri on 6/28/2023 in #help
❔ if you use a string command in an if command, can you make it case insensitive
I put asterisks around the string names in this message in an attempt at making it easier to read lol
22 replies