Skip to content

Commit f7c3dd1

Browse files
authored
Small edits to String.ToCharArray code snippet (#4170)
1 parent 952f079 commit f7c3dd1

File tree

1 file changed

+4
-2
lines changed
  • samples/snippets/csharp/VS_Snippets_CLR_System/system.string.tochararray/cs

1 file changed

+4
-2
lines changed

samples/snippets/csharp/VS_Snippets_CLR_System/system.string.tochararray/cs/ToCharArray1.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ public class Example
55
{
66
public static void Main()
77
{
8-
String s = "AaBbCcDd";
9-
var chars = s.ToCharArray();
8+
string s = "AaBbCcDd";
9+
char[] chars = s.ToCharArray();
1010
Console.WriteLine("Original string: {0}", s);
1111
Console.WriteLine("Character array:");
1212
for (int ctr = 0; ctr < chars.Length; ctr++)
13+
{
1314
Console.WriteLine(" {0}: {1}", ctr, chars[ctr]);
15+
}
1416
}
1517
}
1618

0 commit comments

Comments
 (0)