I have a list of string, which is most likely, but not guaranteed to contain a list of numerics, i.e.,
{\"1\", \"6\", \"2\", \"21\", \"89\"}
This has been asked before slightly differently, but the same answer still applies, as they have a C# implementation on the same site.
SO Question: Sort on a string that may contain a number
Answer provided by ScArcher2: The Alphanum Algorithm
You want to sort elements, just like Windows XP Explorer does with files. See this article on how to do this.
If this is C#, that's what Int32.TryParse() is for.
If this is C++, then std::string::find_first_not_of is a decent bet. Pass it a string containing the ascii chars for the digits 0 to 9 (plus the minus and plus signs?) and if it returns -1 then it is an integer.