Like Us
Plus One
Follow Us
Search
 Author Mikael Svenson  Views 696 View Original Article

I just got a support task where I’m pulling data from an API and need to sort the items based on a chapter like key. The data looks like this: ST.1.1 ST.1.2 ST.1.10 ST.2.20a The data is coming back random, and if I do a pure alfanumeric sorter, then ST.1.10 will sort above ST.1.2, which is lexically incorrect. Since I know I will never have numbers above three digits (ST.999.999), I figured I could sort it all by padding the numbers. This is the solution I ended up with, and i…
View Original Article

Recent Articles from Tech and me