C
C#8mo ago
Ewan

✅ Why arent these variables being printed outside the loop?

No description
15 Replies
Ewan
Ewan8mo ago
the variables on the last line arent being printed out, its just blank, why?
Pobiega
Pobiega8mo ago
because this isnt javascript thats not how Console.WriteLine works
Ewan
Ewan8mo ago
how would i output these variables?
Pobiega
Pobiega8mo ago
use string interpolation
Ewan
Ewan8mo ago
with the $ sign? and the {} ?
Pobiega
Pobiega8mo ago
$"> {fizz} {buzz}..." yea
Ewan
Ewan8mo ago
ohhhh i see ok thanks again!! yay
Pobiega
Pobiega8mo ago
the overload you used is public static void WriteLine (string format, params object?[]? arg); it expects a format string as the first argument, with placeholders
Ewan
Ewan8mo ago
i see
Pobiega
Pobiega8mo ago
generally its preferred to just use string interpolation, and let the compiler decide what to do instead
daniel2
daniel28mo ago
Can I ask a question here?
Ewan
Ewan8mo ago
i knew it wanted string as the first one hence the ">" first. i swear its worked before but ok thank you again!
Pobiega
Pobiega8mo ago
make your own thread, or ask in #help-0
Ewan
Ewan8mo ago
!close
Accord
Accord8mo ago
Closed!