I was expecting it to produce "a-aa", but the result is "a".Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim v1 = (From x In "abcd" Where x = "a" Select x).FirstOrDefault Dim v2 = (From x In "abcd" Where x = "m" Select x).FirstOrDefault Dim v3 = (From x In "abcd" Where x = "a" Select x).FirstOrDefault Dim v4 = (From x In "abcd" Where x = "a" Select x).FirstOrDefault Dim result = Nz(v1, "-") & Nz(v2, "-") & Nz(v3, "-") & Nz(v4, "-") MsgBox(result) End Sub Function Nz(ByVal var As String, ByVal substitiution As String) As String Return If(var IsNot Nothing, var, substitiution) End Function
Any ideas why?




icon on the left of the post.
Reply With Quote
