Difference between revisions of "Console writing and sleeping"
From MyWiki
(Created page with " Console.Write("adsfasdf"); System.Threading.Thread.Sleep(5000); Console.WriteLine("adsfasdfadsfdasfasfd");") |
|||
| Line 2: | Line 2: | ||
System.Threading.Thread.Sleep(5000); | System.Threading.Thread.Sleep(5000); | ||
Console.WriteLine("adsfasdfadsfdasfasfd"); | Console.WriteLine("adsfasdfadsfdasfasfd"); | ||
| + | |||
| + | Program that uses Console.WriteLine with arrays: C# | ||
| + | using System; | ||
| + | class Program | ||
| + | { | ||
| + | static void Main() | ||
| + | { | ||
| + | char[] array = new char[] { 'a', 'b', 'c', 'd' }; | ||
| + | // | ||
| + | // Write the entire char array on a new line. | ||
| + | // | ||
| + | Console.WriteLine(array); | ||
| + | // | ||
| + | // Write the middle 2 characters on a new line. | ||
| + | // | ||
| + | Console.WriteLine(array, 1, 2); | ||
| + | } | ||
| + | } | ||
Revision as of 12:58, 23 June 2014
Console.Write("adsfasdf");
System.Threading.Thread.Sleep(5000);
Console.WriteLine("adsfasdfadsfdasfasfd");
Program that uses Console.WriteLine with arrays: C#
using System;
class Program
{
static void Main()
{
char[] array = new char[] { 'a', 'b', 'c', 'd' }; // // Write the entire char array on a new line. // Console.WriteLine(array); // // Write the middle 2 characters on a new line. // Console.WriteLine(array, 1, 2);
} }