2.41. Conclusion
Here we have seen the basics of representing strings (both single-quoted and double-quoted). We’ve seen how to interpolate expressions into double-quoted strings, and how the double quotes also allow certain special characters to be inserted with escape sequences. We’ve seen the %q and %Q forms, which permit us to choose our own delimiters for convenience. Finally, we’ve seen the here-document syntax, carried over from older contexts such as Unix shells.
This chapter has demonstrated all the important operations a programmer wants to perform on a string. These include concatenation, searching, extracting substrings, tokenizing, and much more. We have seen how to iterate over a string by line or by byte. We have seen how to transform ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access