I have a string like this:
var allString = "|AQW12|2|34|33|12|<br>|AQW11|2|34|33|12|<br>|AQW09|2|34|33|12|<br>";
Basically this is some sort of table where column names would be delimetered by | and <br> delimits the rows.
My question is how you would go to sort the allString by column 2 (i.e. AQW12, AQW11, etc),.
Thank you
quick solution, excuse the bad variable names:
output:
the variable
l3contains the data in array form:for comments on
localCompare, refer to https://stackoverflow.com/a/2167619/1689451of course, you could also use method chaining, if you like to show off 🙂