splitting and joining arrays and strings