Skip to content
Prev 363078 / 398502 Next

Regression expression to delete one or more spaces at end of string

Double the [[]] and add a + for one-or-more characters: 

sub("[[:blank:]]+$", "", COLNAMES)
--
Dr. David Forrest
drf at vims.edu
804-684-7900w
757-968-5509h
804-413-7125c
#240 Andrews Hall
Virginia Institute of Marine Science
Route 1208, Greate Road
PO Box 1346
Gloucester Point, VA, 23062-1346