100-days-of-rust/Week-08/Day-56_Convert-To-Hex/README.md

16 lines
440 B
Markdown
Raw Normal View History

2023-03-24 01:14:34 +00:00
# Convert to Hex
Create a function that takes a strings characters as ASCII and returns each characters hexadecimal value as a string.
## Examples
```text
toHex("hello world") ➞ "68 65 6c 6c 6f 20 77 6f 72 6c 64"
toHex("Big Boi") ➞ "42 69 67 20 42 6f 69"
toHex("Marty Poppinson") ➞ "4d 61 72 74 79 20 50 6f 70 70 69 6e 73 6f 6e"
```
## Notes
- Each byte must be seperated by a space.
- All alpha hex characters must be lowercase.