
Remove Trailing and Leading Characters From Character Strings
crop.RdSimilarly to the function trim from the gdata package, this function
can be used to remove trailing and leading spaces from character strings. However,
in contrast to trim, any character can be removed by crop.
Examples
str <- c(" 12 kk ", "op j q ", "110")
crop(str)
#> [1] "12 kk" "op j q" "110"
crop(str, "op")
#> [1] " 12 kk " " j q " "110"