i

R Programming Complete Tutorial

R String Construction

String Operation

In this chapter, first, we will know the rules to construct a string. After that, we will discuss detail on string manipulation functions.

String Construction

A string should be specified with a quote:

Rule 1: The quotes at the beginning and end of a string should be either double quotes or both single quote. They cannot be mixed.

A string should be specified with a quote:

Rule 1: The quotes at the beginning and end of a string should be either double quotes or both single quote. They cannot be mixed.

Rule 2: Double quotes can be inserted into a string starting and ending with a single quote. A single quote can also be inserted into a string starting and ending with double-quotes.

Rule 3: Double quotes cannot be inserted into a string starting and ending with double-quotes. A single quote cannot be inserted into a string starting and ending with a single quote.