range result in Tuple! and how to convert into assocArray by sort?
MichaelBi
shunjie.bi at gmail.com
Tue May 10 03:22:04 UTC 2022
s is the string, and print result as following:
s.array.sort!("a<b").group.assocArray.byPair.array.sort!("a[0]<b[0]").each!writeln;
Tuple!(dchar, "key", uint, "value")('A', 231)
Tuple!(dchar, "key", uint, "value")('C', 247)
Tuple!(dchar, "key", uint, "value")('G', 240)
Tuple!(dchar, "key", uint, "value")('T', 209)
then how to transfer into
[['A',231],['C',247],['G',240],['T',209]]? tried map!, but can
only sortout key or value... tried array(), but result is not
sorted then...thanks in advance.
More information about the Digitalmars-d-learn
mailing list