Assignment:
Create a function that can convert a string to its encoded hexadecimal value.
- In your answer, also show how to run this function (to validate answers).
- Your function must return OR print this text to STDOUT or any acceptable alternative.
- Your return value doesn't need to have whitespace between hexadecimal pairs.
- You may not use libraries/packages in general and any other functions that directly converts a string to hexadecimal. For example, using a function or package to convert the string to bytes is OK.
- This is Code Golf, so shortest code wins.
Example Input:
Input Example:
Hello World!
Output Examples:
48 65 6c 6c 6f 20 57 6f 72 6c 64 21
OR
48656c6c6f20576f726c6421