How to print text diagonally from left to right in VB.NET

1 Answer

0 votes
Imports System
				
Module Module1

	Sub PrintDiagonalText(text As String)
        For i As Integer = 0 To text.Length - 1
            ' Print i spaces before the character
            Console.WriteLine(New String(" "c, i) & text(i))
        Next
    End Sub

    Sub Main()
        Dim message As String = "HELLO WORLD"
	
        PrintDiagonalText(message)
    End Sub

End Module



' run:
'
' H
'  E
'   L
'    L
'     O
'       
'       W
'        O
'         R
'          L
'           D
' 

 



answered Apr 7 by avibootz
...