I have the below code for adding ordinals such as st,rd,th and so on..
Private ordinals As String() = New String() {"", "st", "nd", "rd", "th", "th", _
"th", "th", "th", "th", "th", "th", _
"th", "th", "th", "th", "th", "th", _
"th", "th", "th", "st", "nd", "rd", _
"th", "th", "th", "th", "th", "th", _
"th", "st"}
For getting date I'm writing it as follows:
Dim D As DateTime = Me.PresentDate.Value.ToString("MM-dd-yyyy")
Dim todate As String = D.Day.ToString() + ordinals(D.Day)
Result:
5th
But I would like to get the result as shown below
Why not just use the superscript characters in the first place?
or create a simple lookup dictionary: