You can use ncharto search the length of each element of the vector
> nchar(str.vect)
[1] 6 6 6 6
Then you combine this with strtrimto get the beginning of each line
> strtrim(str.vect, nchar(str.vect)-3)
[1] "abc" "abc" "abc" "abc"
To get the end of a word, you can use substr(in fact, you can use substr to get a start too ...)
> substr(str.vect, nchar(str.vect)-1, nchar(str.vect))
[1] ".1" ".1" ".2" ".2"
And finally, you use paste0(which pastec sep="") to connect them
> paste0(strtrim(str.vect, nchar(str.vect)-3), # Beginning
substr(str.vect, nchar(str.vect)-1, nchar(str.vect))) # End
[1] "abc.1" "abc.1" "abc.2" "abc.2"
There are simpler ways if you know your lines have some special characteristics.
, 6, nchar .
EDIT: R , .
> gsub(".(..)$", "\\1", str.vect)
[1] "abc.1" "abc.1" "abc.2" "abc.2"
, , , .
(".(..)$") - ,
. , $ .
, ...$ 3 .
, .
, . \\1, ", ".
, : " ".