-
Console.WriteLine("Hello World")
prints the output on the existing line and appends a new line after it.Console.Write("hello"); Console.Write("World");
print in the same line -
.WriteLine()
and.Write()
are both methods in the classConsole
- comparison operators:
> < >= <=
- equality and inequality operator:
== !==
- logical negation operator:
!
- declare a string :
string myString = "This is a string";
- string method:
Contains(), StartsWith(), EndsWith(), ToLower(), ToUpper(), Trim()
- A literal value is a constant value that never changes. There are 5 common literal data types.
- character literals: one single alphanumeric character,
Console.WriteLine('b')
single quotes create achar
literal and double quotes create a string literal - integer literals:
int
- floating-point number:
float
append letterF
after the number,double
anddecimal
add letterm
orM
will both work - boolean
- implicitly typed:
var
(Note: This doesn't equal to dynamically typed) - Using template literals and string interpolation allows easy way to interpolate variables and expressions
Console.WriteLine($"Hello {firstName}!")
Top comments (0)