VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,768 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How to convert the C# code to VB.NET?
var possibleDuplicateFiles = files.GroupBy(f => f.Length).Where(s => s.Count() > 1).SelectMany(f => f).ToList()
Thank you
Hi,
for C#:
var possibleDuplicateFiles = files.GroupBy(f => f.Length).Where(s => s.Count() > 1).SelectMany(f => f).ToList()
in VB.NET you get:
Dim possibleDuplicateFiles = files.GroupBy(Function(f)
Return f.Length
End Function).Where(Function(s)
Return s.Count > 1
End Function).SelectMany(Function(f)
Return f
End Function).ToList
or
Dim possibleDuplicateFiles = files.GroupBy(Function(f) f.Length).Where(Function(s) s.Count > 1).SelectMany(Function(f) f).ToList
You can use C# to VB.NET Converter for free for output up to 100 lines per file. There is a snippet option that can convert snippets such as you are asking about.