Update lengthOfLastWord