strtrim dalam r

# To remove the last character
name <- "Rocku0"
remaining_length <- nchar(name) - 1
strtrim(name, remaining_length)
Rocku0