How to Capitalize All First Letters of the Words in String In C++

This is the logic building and interesting C++ programming exercise. The C++ program Capitalize all first letters of the Words in String in a given string e.g. “how are you pro programer” to ” How Are You Programmer”.

Source Code 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace capitalizeFirst
{
class Program
{
static void Main(string[] args)
{

//Your code goes here
Console.WriteLine("Hello, world!");
String userEntered = "";
Console.WriteLine("Enter some text to capitalize first letter");
userEntered = Console.ReadLine();
Console.WriteLine(userEntered.First().ToString().ToUpper()+ userEntered.Substring(1));
userEntered = Console.ReadLine();
}
}
}

Output of the Program


 Capitalize All First Letters of the Words in String In C++

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment