Hey all!
In a console app, you can condense strings by using this code on line 5:
vb Code:
Dim R As New Random() Dim l As Int32 = R.Next(10) Dim m As Int32 = R.Next(10) Dim n As Int32 = R.Next(10) Console.WriteLine("L is {0} and M is {1} and N is {2}.", l, m, n) Console.ReadLine()
But why can't you create a normal string that way? Is the long way the only other way to do it?
vb Code:
'' How do I go from this: Dim s As String = "L is " & l & " and M is " & m & " and N is " & n & "." '' To this: Dim s As String = ("L is {0} and M is {1} and N is {2}.", l, m, n)
Thanks!
Nic




Reply With Quote
