Updated StringTokeniser to handle empty strings