1.9 KiB
1.9 KiB
Hints
General
- Read about strings in the official Getting Started guide.
- Browse the functions available in the String module to discover which operations on strings Elixir's standard library offers.
1. Get the name's first letter
- There is a built-in function to get the first character from a string.
- There are multiple built-in functions to remove leading, trailing, or leading and trailing whitespaces from a string.
2. Format the first letter as an initial
- There is a built-in function to convert all characters in a string to their uppercase variant.
- There is an operator that concatenates two strings.
3. Split the full name into the first name and the last name
- There is a built-in function that splits a string on whitespace characters.
- A few first elements of a list can be assigned to variables by pattern matching on the list.
4. Put the initials inside of the heart
- There is a special syntax for interpolating an expression inside of a string.
- There is a special syntax for writing multiline strings without needing to escape newlines.