Extract string to array method