![]() |
VOOZH | about |
substring() function in R Programming Language is used to extract substrings in a character vector. You can easily extract the required substring or character from the given string.
Syntax: substring(text, first, last)
Parameters:
- text: character vector
- first: integer, the first element to be replaced
- last: integer, the last element to be replaced
Output :
[1] "ee" [1] "Geek" [1] "G" [1] "g"
Output:
[1] "FG" "fg" "ee" [1] "GFG" "gfg" "Gee" [1] "F" "f" "e"
Output:
[1] "G@G" "g@g" "G@eks"