A playground for C# codes & notes
- arithmetic operations ( +, - * , /, etc) on
Char
or when accessing char xters in astring
will return the ASCII value (i.e numbers) of each char respectively.
Ex: string word1= "mum"; string word2 = "dad";
for (int i = 0; i < word1.Length; i++)
{
var aa = word1[i]; //output: mom
var bb = word1[i] + word2[i]; // output: 209208209
}
-
You cannot access/do anything with a null object. Hence, take precaution, initialize! Ex, string.Empty for strings & int = 0.
-
StringBuilder 'append' to add to strings instead of writing to the console. This is more efficient.
-
[ ]
-
[ ]