vectorize nchar