Imports System
Imports System.Linq
Imports System.Collections.Generic
Public Class Program
Public Shared Function CreateCharacterRangeList(ByVal startChar As Char, ByVal endChar As Char) As List(Of Char)
If endChar < startChar Then
Throw New ArgumentException("End character must be greater than or equal to start character.")
End If
Return Enumerable.Range(Convert.ToInt32(startChar), Convert.ToInt32(endChar) - Convert.ToInt32(startChar) + 1).
Select(Function(i) Convert.ToChar(i)).
ToList()
End Function
Public Shared Sub PrintCharacters(ByVal charList As List(Of Char))
For Each ch As Char In charList
Console.Write(ch & " ")
Next
Console.WriteLine()
End Sub
Public Shared Sub Main()
Dim start As Char = "a"c
Dim _end As Char = "m"c
Dim charList As List(Of Char) = CreateCharacterRangeList(start, _end)
PrintCharacters(charList)
End Sub
End Class
' run:
'
' a b c d e f g h i j k l m
'