C
C#2y ago
MR1R0B0T

✅ Results in Console won't give me the values that I need in printing them

I would like to ask what's wrong with my code why it won't print the other methods value but instead only the first value? Was this because of the parameters I used? This is my code: Console.WriteLine("Results: "); string reversedFirstName = ReverseString(firstName); string reversedLastName = ReverseString(lastName); string reversedCity = ReverseString(city); Console.WriteLine(reversedFirstName, reversedLastName, reversedCity );
3 Replies
Jimmacle
Jimmacle2y ago
you should read the documentation for that overload of WriteLine because it's not doing what you expect https://learn.microsoft.com/en-us/dotnet/api/system.console.writeline?view=net-8.0#system-console-writeline(system-string-system-object-system-object)
Angius
Angius2y ago
Console.WriteLine() in C# does not work like console.log() in JS It does not let you print multiple things with one call
MR1R0B0T
MR1R0B0TOP2y ago
I see. Thank you for explaining this!
Want results from more Discord servers?
Add your server