Counting number of words in a string - c# program, DOT NET Programming

Assignment Help:

Counting Number of Words in a String - C# Program

Anyone can suggest me the output of the following program.

using System;  

class CountWords

{

public static void Main()

{

string s = ""; // Declare 's' of string type  

Console.Write("Enter the string : ");    

S = Console.ReadLine(); // Read string from the console & save in 's'    

string [] words = s.Split(null);

// 'words' is an array of string type

// string 's' will split when a space (null) is encountered

// This will be saved into array words     

int i = words.Length; // Just count the lenght of array 'words'  

Console.WriteLine("The total number of words in the entered string : "+i);    

Console.ReadLine();

}

}


Related Discussions:- Counting number of words in a string - c# program

Describe the eventlog class, Describe the EventLog class. The EventLog ...

Describe the EventLog class. The EventLog class is used to access the Windows event logs from Windows services. Using EventLog, you can also customize Windows event logs that r

I need cell phone pinging for fugitive tracking, I need CELL PHONE PINGING ...

I need CELL PHONE PINGING for fugitive tracking Project Description: I want an application like the following: it provides cell phone pinging(location information via gps) wi

I need c# programmer, I need C# Programmer Project Description: To he...

I need C# Programmer Project Description: To help in the production of a C# module to provide a web service. We are based in Littlehampton, West Sussex. Skills required ar

Explain toolstrip drop-down button and split button, What is the difference...

What is the difference among a toolstrip drop-down button and a toolstrip split button? The difference among a toolstrip drop-down button and a toolstrip split button is that a

Dynamic web presentation tier, Part 1 requires you to complete a dynamic we...

Part 1 requires you to complete a dynamic web presentation tier, based on your MiddlewareLib.dll  library. This should run as an ASP.NET page, Default.aspx, under WebDev.WebServer,

Audio expert in c# required and generate audio engine, Audio Expert in C# R...

Audio Expert in C# Required - Generate Audio Engine, Exciting Project! Project Description: We need an EXPERT CODER to help us create an 'audio engine' in C#. We need to b

What are the criteria necessary for an effective network, What are the crit...

What are the criteria necessary for an effective and efficient network? a. Performance It can be measured in several ways, including transmit time and response time. b

Relation between classes and objects, What is the relation between Classes ...

What is the relation between Classes and Objects? The class & object look very much same but are not same. The Class is a definition, while object is a instance of the class cr

What is plinq, What is PLINQ? PLINQ stands for Parallel Language Integr...

What is PLINQ? PLINQ stands for Parallel Language Integrated Query. It is the parallel execution of LINQ, in which a query can be implemented by using multiple processors. PLIN

laura

2/12/2013 1:27:49 AM

This a very easy example... the output is:

 Enter the string : Daljit is making programs
 The total number of words in the entered string : 4

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd