Optimized string parsing.