.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson
Eminent IT

Home >> Code Snippets >> LINQ >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Counting the Number of Characters in a Whole String Array

Posted By:Hefin Dsouza       Posted Date: August 12, 2009    Points: 10    Category: LINQ    URL: http://www.dotnetspark.com  

Works only with Framework 3.5
Using Linq we can also count the total number of characters in an whole string array.

With just a simple querry.

        Dim names() As String = {"Hefin", "DOTNETSPIDER", "VB.net", "VisualStudio"}

        Dim n As Integer = names.Sum(Function(w) w.Length)
        Console.WriteLine("Total Number of Characters in the Whole Array is : " & n)

Hefin Dsouza


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend