How to use interpolated strings to insert variables values and expression into a string with VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()
        Dim lang = "VB.NET"
        Dim n = 13
        Dim s = $"Name:{lang} {n:D2}{(If(n = 99, "*", "!"))}"

        Console.WriteLine(s)
    End Sub

End Module


' run:
' 
' Name:VB.NET 13!

 



answered Oct 21, 2018 by avibootz

Related questions

2 answers 226 views
1 answer 177 views
1 answer 176 views
1 answer 182 views
...