How to output an int type as a hexadecimal string?
See the code example below:
Int j = 256;
String s = j.ToString(“X”);
The value X instructs the output to be in hexadecimal format. The output would be:
Note that 100 is the hexadecimal (a number with base 16) equivalent of the number 256 with base 10.
If we want to set the precision of characters in the output format, we can add a number to the X. For example
string s1 = j.ToString(“X5”);
Display 5555 as 0005555
Initialize string from a char
Format decimal as currency
Output int type as hexadecimal string
Display a number in exponential
Display a number as a percent
Is String a reference type
@ before double quotes
Escape Sequence Why do we use backslash characters with strings?
String VS. string
More Interview Questions.....