R Substring Method