@carlor wrote:
Hi there,
I’m trying create a piece of code to do some string find/replace using InvokeCode but I’m running into a syntax error that I can’t figure out.
Dim test01 As String = “#first string# here is some text #second string# and more text”
Dim test02 As String = “#first string# here is some more text I don’t care about”
Dim items As New System.Collections.Generic.List(Of Integer)
items = test01.Select(Function(c, i) New With {.Character = c, .Index = i}) _
.Where(Function(item) item.Character = “#”) _
.ToList
Dim count As Integer = items.CountThis works in Visual Studio but I’m getting an error message that on the “items =” line: the List(Of anonymous type) can’t be converted to List(Of Integer)
Any ideas?
Thanks,
Carlo.
Posts: 8
Participants: 3