Write a function/method/subroutine/... that when given an integer greater than or equal to zero returns a string of the number followed by an apostrophe then the ordinal suffix.



Example

Returns would include 1'st 2'nd 3'rd 11'th 111'th 1001'st 1012'th



Task

Use your routine to show here the output for at least the following (inclusive) ranges of integer inputs:
0..25, 250..265, 1000..1025


Note: apostrophes are now optional to allow correct apostrophe-less English.




' FB 1.05.0 Win64
 
' Apostrophes NOT used as incorrect English
 
Function ordinal(n As UInteger) As String
  Dim ns As String = Str(n)
  Select Case Right(ns, 1)
    Case "0", "4" To "9"
      Return ns + "th"
    Case "1"
      If Right(ns, 2) = "11" Then Return ns + "th" 
      Return ns + "st"
    Case "2"
      If Right(ns, 2) = "12" Then Return ns + "th" 
      Return ns + "nd"
    Case "3"
      If Right(ns, 2) = "13" Then Return ns + "th" 
      Return ns + "rd"
  End Select
End Function    
 
Dim i As Integer
For i = 0 To 25
  Print ordinal(i); " ";
Next
Print : Print
 
For i = 250 To 265
  Print ordinal(i); " ";
Next
Print : Print
 
For i = 1000 To 1025
  Print ordinal(i); " ";
Next
Print : Print
 
Print "Press any key to quit"
Sleep