Formatting.jl
Formatting.jl copied to clipboard
Improved string safety, and slight performance considerations
- Improved string safety by using
SubString,prevind,nextind,firstindex, andlastindexwhere possible. - Made performance improvements by changing
findfirst(isequal(c), str)tofindfirst(c, str)(no allocating, much faster), and by searching forisdigitinstead of using regex withinaddcommas. UsingSubStringalso seemed to be faster.
All tests passing. Please let me know if you need anything else :slightly_smiling_face: