divide a string into n equal parts