I provided 14 different ways of 'checking if a string is digits only' with a string consisting of 123 followed by a newline.
We finish off our short series on SLM optimization with the third entry, focused on batching by length instead of looping ...