ruby version of string sub