Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do `select` and `sub` have brackets around them in VB Linq expressions?

I converted the following query from C#:

src.Select((c, i) => src.Substring(i)).Count(sub => sub.StartsWith(target))

to the VB.NET query:

src.[Select](Function(c, i) src.Substring(i)).Count(Function([sub]) [sub].StartsWith(target))

Using Developer Fusion. I was just wondering why the VB.NET version has [] throughout.

like image 808
Riddari Avatar asked Dec 03 '22 07:12

Riddari


1 Answers

select and sub are keywords in VB.NET

like image 97
cadrell0 Avatar answered Feb 09 '23 01:02

cadrell0