How to find all 3 letters words from a list in VB.NET

1 Answer

0 votes
Imports System
Imports System.Linq
Imports System.Collections.Generic
 
Public Class Program
    Public Shared Sub Main(ByVal args As String())
        Dim lst As List(Of String) = New List(Of String) From {
            "python",
            "c",
            "c++",
            "c#",
            "java",
			"vb",
            "php",
            "nodejs",
            "ada"
        }
         
        Dim threeLetter_words As List(Of String) = lst.Where(Function(word) word.Length = 3).ToList()
           
        Console.WriteLine(String.Join(", ", threeLetter_words))
    End Sub
End Class
  
    
    
' run:
'
' c++, php, ada
'

 



answered Jun 21, 2024 by avibootz
edited Jun 21, 2024 by avibootz

Related questions

1 answer 103 views
1 answer 143 views
1 answer 119 views
1 answer 99 views
1 answer 107 views
1 answer 99 views
...