Created
August 22, 2014 18:23
-
-
Save kenwilcox/44cb33ec8519211c5165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
namespace CSharpBug | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
/* | |
Expected Output: | |
Test *.log | |
Test *.log | |
Test *.log | |
Test *.log | |
Done | |
Actual Output: | |
Test | |
Test *.log | |
Test *.log | |
Test *.log | |
Done | |
*/ | |
try | |
{ | |
string fileMask = "*.log"; | |
Console.WriteLine("Test", fileMask); // bug! fileMask will NOT be shown | |
Console.WriteLine(String.Format("Test {0}", fileMask)); | |
Console.WriteLine(String.Format(Thread.CurrentThread.CurrentCulture, "Test {0}", fileMask)); | |
object[] objArray = new object[] { fileMask }; | |
Console.WriteLine(String.Format(Thread.CurrentThread.CurrentCulture, "Test {0}", objArray)); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine(e.Message); | |
} | |
Console.WriteLine("Done"); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment