How do you find the length of a string in R?

How do you find the length of a string in R?

a) strlen()
b) length()
c) nchar()
d) str_len()

Answer:

c) nchar()

Explanation:

The nchar() function in R returns the number of characters in a string.

Reference:

R Programming – String MCQ Questions and Answers

Scroll to Top