Possible Duplicate: Equivalence of “With…End With” in C#?
So I don't know if this question has been asked before and I am not a big fan of VB.NET. But one syntax that I am missing in C# is the With
syntax.
In VB.NET you can write:
Dim sb As New StringBuilder
With sb
.Append("foo")
.Append("bar")
.Append("zap")
End With
Is there a syntax in C# that I have missed that does the same thing?