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

What is a cloud service, What is a Cloud Service? A cloud service is us...

What is a Cloud Service? A cloud service is used to build cloud applications. This service gives the facility of using the cloud application without installing it on the comput

I need c# gmail api and wikia api, Project Description: I am preparing a...

Project Description: I am preparing a speech recognition program and need a quick code to get it done I am seeking for someone to create a Gmail API that can get subject, and co

Visual basic, how do I load txt file into listbox

how do I load txt file into listbox

Built a fairly standard core application skeleton, Here's the General Backg...

Here's the General Background on our project work: We need your help building out a new application that's part of a new startup in the Silicon Valley. We've built a fairly s

Difference between shadowing and overriding, What is the difference between...

What is the difference between Shadowing and Overriding? The main basic difference between shadowing and overriding are as follows:- 1) The Overriding redefines only the imp

Update present website backend build rest api to expose data, Update presen...

Update present website backend (asp.NET) as well as build Rest API to expose data I will soon build an HTML5 cross-platform mobile app. I previously have a website with a backen

Describe the services that uddi provides to web applications, Describe the ...

Describe the services that UDDI provides to Web applications. UDDI gives the following types of services to a Web application: XML Schema for business descriptions - Contain

Finding maximum & minimum numbers - c# program, Finding Maximum & Minimum N...

Finding Maximum & Minimum Numbers - C# Program I am facing some problems in the code for Finding Maximum & Minimum Numbers. Can anybody suggest me the proper code for it.

Elements in functions points, What are the different elements in Functions ...

What are the different elements in Functions points? 1) Internal Logical Files (ILF): Following are some points to be noted for ILF:- The ILF are logically related d

Develop a alphabates and numbers generators screen, how we can display a a...

how we can display a alphabets by identifies an image and if its different than show someother alpbabets.

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