split str into array and check length