C# Brain dump

In a moment of severe mental weakness, I couldn't remember how to assign an integer's value as a text (string) value (yes, really). I found it funny enough to write up here. Here's what I tried (this actually works!):

this.lblItemID.Text = ((int)0).ToString();

After I wrote it, I just stared at it for a few seconds, before realizing the better (and easier, and obvious) way:

this.lblItemID.Text = "0';

I don't even know where that first sample came from...I was just typing along and suddenly, there it was. Sheesh.

Comments

Post new comment