我有以下代码用于添加诸如 st、rd、th 等序数。
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"}
为了获取日期,我将其编写如下:
Dim D As DateTime = Me.PresentDate.Value.ToString("MM-dd-yyyy")
Dim todate As String = D.Day.ToString() + ordinals(D.Day)
结果:
第 5 名
但我想得到如下所示的结果