Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Strings basics
5. Join strings
Regular expressions
Modifying strings
Summary

Instruction

Now we need to add last names to our names. How can we join two or more strings? Just use the paste() function:

paste("Leopold", "Bloom")

The paste() function uses a space as a default "glue", so we'll get:

Leopold Bloom

Note that by default the two strings are joined with space ( ).

Exercise

Join two vectors of strings: first_names and last_names.

Observe that the paste() function also works with a vector of strings.