Skip to content

Instantly share code, notes, and snippets.

@kenwilcox
Created August 22, 2014 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwilcox/44cb33ec8519211c5165 to your computer and use it in GitHub Desktop.
Save kenwilcox/44cb33ec8519211c5165 to your computer and use it in GitHub Desktop.
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