Skip to content

Commit ba98ee9

Browse files
Youssef1313Ron Petrusha
authored andcommitted
Fix \n in visual basic code (#1437)
* Fix `\n` in visual basic code * Update stderror-sync.vb * Update stderror-sync.vb * Update process_getprocessesbyname2_2.vb * Update getvalue1.vb * Update sample.vb
1 parent bc66c55 commit ba98ee9

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

snippets/core/deploying/vb/deployment-example.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Namespace Applications.ConsoleApps
77
Console.WriteLine()
88
Dim s = Console.ReadLine()
99
ShowWords(s)
10-
Console.Write("\nPress any key to continue... ")
10+
Console.Write($"{vbCrLf}Press any key to continue... ")
1111
Console.ReadKey()
1212
End Sub
1313

snippets/visualbasic/VS_Snippets_CLR/Process_GetProcessesByName2_2/VB/process_getprocessesbyname2_2.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ Class GetProcessesByNameClass
4545
Catch e As PlatformNotSupportedException
4646
Console.WriteLine(
4747
"Finding notepad processes on remote computers " &
48-
"is not supported on this operating system.");
48+
"is not supported on this operating system.")
4949
Catch e As InvalidOperationException
5050
Console.WriteLine("Unable to get process information on the remote computer.")
5151
End Try
52-
End Sub 'Main
53-
End Class 'GetProcessesByNameClass
52+
End Sub
53+
End Class
5454
' </Snippet1>
5555
' </Snippet2>

snippets/visualbasic/VS_Snippets_CLR_System/system.String.TrimStart/vb/sample.vb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ Public Class TrimExample
5151
' <Snippet1>
5252
Public Sub Main()
5353
' TrimStart Examples
54-
Dim lineWithLeadingSpaces as String = " Hello World!";
55-
Dim lineWithLeadingSymbols as String = "$$$$Hello World!";
56-
Dim lineWithLeadingUnderscores as String = "_____Hello World!";
57-
Dim lineWithLeadingLetters as String = "xxxxHello World!";
54+
Dim lineWithLeadingSpaces as String = " Hello World!"
55+
Dim lineWithLeadingSymbols as String = "$$$$Hello World!"
56+
Dim lineWithLeadingUnderscores as String = "_____Hello World!"
57+
Dim lineWithLeadingLetters as String = "xxxxHello World!"
5858
Dim lineAfterTrimStart = String.Empty
5959

6060
' Make it easy to print out and work with all of the examples

snippets/visualbasic/VS_Snippets_CLR_System/system.reflection.propertyinfo.getvalue/vb/getvalue1.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ End Class
3131

3232
Module Example
3333
Public Sub Main()
34-
Dim jupiter As New Planet("Jupiter", 3.65e08);
34+
Dim jupiter As New Planet("Jupiter", 3.65e08)
3535
GetPropertyValues(jupiter)
3636
End Sub
3737

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Imports System.Diagnostics'
1+
Imports System.Diagnostics
22

33
Public Module Example
4-
Public Sub Main()
5-
Dim p As New Process()
6-
p.StartInfo.UseShellExecute = False
7-
p.StartInfo.RedirectStandardError = True
8-
p.StartInfo.FileName = "Write500Lines.exe"
9-
p.Start()
4+
Public Sub Main()
5+
Dim p As New Process()
6+
p.StartInfo.UseShellExecute = False
7+
p.StartInfo.RedirectStandardError = True
8+
p.StartInfo.FileName = "Write500Lines.exe"
9+
p.Start()
1010

11-
' To avoid deadlocks, always read the output stream first and then wait.
12-
Dim output As String = p.StandardError.ReadToEnd()
13-
p.WaitForExit()
11+
' To avoid deadlocks, always read the output stream first and then wait.
12+
Dim output As String = p.StandardError.ReadToEnd()
13+
p.WaitForExit()
1414

15-
Console.WriteLine($"\nError stream: {output}");
16-
End Sub
15+
Console.WriteLine($"{vbCrLf}Error stream: {output}")
16+
End Sub
1717
End Module
1818
' The end of the output produced by the example includes the following:
1919
' Error stream:
20-
' Successfully wrote 500 lines.
20+
' Successfully wrote 500 lines.

0 commit comments

Comments
 (0)