Imports System.Collections
public class Test
public Shared Sub Main
Dim txt As String = "asdf"
Dim letter_stack As New Stack
For i As Integer = 0 To txt.Length - 1
Console.WriteLine(i)
letter_stack.Push(txt.Substring(i, 1))
Next
Do While letter_stack.Count > 0
Console.WriteLine(DirectCast(letter_stack.Pop(), String))
Loop
End Sub
End class
|