You're given a string and asked to find out how many characters it contains. How would you do that in R?

  • Use the len() function
  • Use the length() function
  • Use the nchar() function
  • Use the strlen() function
In R, the nchar() function is used to find out how many characters a string contains. For example, nchar("Hello") would return 5.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *