How to get first letter of each word in a string with VB.NET

1 Answer

0 votes
Imports System
Imports System.Linq

Public Class Program
	Public Shared Sub Main()
        Dim str As String = "VB.NET is a multi-paradigm object-oriented programming language"
		
        Dim firstletters As String = String.Join(" ", str.Split(" "c).ToList().ConvertAll(Function(word) word.Substring(0, 1)))
			
        Console.Write(firstletters)
    End Sub
End Class




' run:
'
' V i a m o p l
'

 



answered Jun 21, 2022 by avibootz
...