|You did not supply a lot of information but based on your question you can use the 'Regex.Replace' method to insert a space at the beginning of each line -
Public Module Program
Public Sub Main()
Dim code As String = "For i As Integer = 0 To 9" & vbCrLf & " Console.WriteLine(i)" & vbCrLf & "Next"
' Regex pattern to match the start of each line
Dim pattern As String = "(^|\n)"
' Insert a space at the beginning of each line
Dim myCode As String = Regex.Replace(code, pattern, " $1")
' Output the modified code