Session Ready
Exercise

Padding

Padding strings is useful in many real-world situations. Earlier in this course, we learned about string concatenation and how to combine the customer's first and last name separated by a single blank space and also combined the customer's full name with their email address.

The padding functions that we learned about in the video are an alternative approach to do this task. To use this approach, you will need to combine and nest functions to determine the length of a string to produce the desired result. Remember when calculating the length of a string you often need to adjust the integer returned to get the proper length or position of a string.

Let's revisit the string concatenation exercise but use padding functions.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3
  • Add a single space to the end or right of the first_name column using a padding function.
  • Use the || operator to concatenate the padded first_name to the last_name column.