In this tutorial you will learn about the R String Length and its application with practical example.
R String Length
In R, the nchar() function is used to count number of characters in a string including the space.
Syntax:-
1 |
nchar(str) |
str:- It is a vector input representing a string.
Example:-
1 2 3 |
print("W3Adda - R String Length.") result <- nchar("Hello, W3Adda") print(result) |
Output:-