This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I agree that your formula works too. But did you know that it outperforms my formula? Testing on 10,000,000 records the average run-time of 8.5 seconds was reduced to 7.7 seconds. In comparison to a regular expression variation of the formula, both are significantly faster by almost 3x. The regular expression is the tortoise in that race.
But don't get too excited about beating me. I found this expression to be 6.8 seconds and so far the fastest of them all:
Returns the length of the initial segment of the string [x] consisting of characters in the string [y]