Letter Ranking System, Checking Higher Rank

Alright so my game right now assigns a rank when you complete each level that is C, B, A, or S

my problem is when i save the rank, i want to only save it if it’s higher than the previously saved rank (e.g. don’t save rank A if S is already saved)

the only ways i can think of seem messy and would require big if/switch statements

with how im using the rank elsewhere i cannot change the ranks to numbers, i must leave them letters

i could save ANOTHER rank thats a number alongside the letter ranking but this seems messy too

any ideas? thanks

Something like

rankToSave = ( System.BitConverter.ToInt32 (System.Text.ASCIIEncoding.GetBytes ((newRank), 0) % 70) < ( System.BitConverter.ToInt32 (System.Text.ASCIIEncoding.GetBytes ((oldRank), 0) % 70 ) ? newRank : oldRank;

(not tested)

should do it in one line. That’s a ridiculous hack, but so is your whole letter based ranking system in the first place, so…