c++ first letter of string

#include <iostream>
#include <string>

int main() 
{
  string str{};     // creating string
  getline(cin, str);// using getline for user input
  std::cout << str; // output string namePerson
  if (str[0] >= 'a' || str[0] <= 'z')
    str[0] -= 32;
  return (0);
}

3.9
10
Third News 105 points

                                    // string::at
#include &lt;iostream&gt;
#include &lt;string&gt;

int main ()
{
  std::string str (&quot;Test string&quot;);
  for (unsigned i=0; i&lt;str.length(); ++i)
  {
    std::cout &lt;&lt; str.at(i);
  }
  return 0;
}

3.9 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
get first character string c++ get first character c++ find first char in string c++ c++ get first letter of std::stint string get first element c++ get first chars in string c++ c++ first char of string c++ first characters of string how to get first letter of string in c++ access first element in String in C++ get first character in string c++ check if first letter of string is a certain character c++ string find first char c++ c++ first chars of string till al certain letter get first element of string c++ get first character of string in c+ how to access first element of string c++ c++ print first character of string how to find the first letter of a string in c++ find the first word in a string c++ c++ check first character of string first letter of string in c++ How do you get the first letter of a string in C++? how to print first letter of string in c++ first letter of string c++ access first letter of string c++ check the first value of the string c++ c++ string get first char how to acess the first element of string in c++ c++ get first word in string get first word of string c++ get first word on string c++ c++ first char in string cpp take first letter of string c++ get first letter of string how to get first char of string in cpp first element of string in c++ c++ find first instance of char in string first element of string c++ how to print the first character of a string in c++ how to store first letter of a string in cpp c++ check first character of string c++ string find first of how to get first letter of string c++ first character of string c++ how to get first char of string in c++ taking the first character c++ taking the first letter c++ find first letter of different words in a string c++ c++ string first letter find first character in string c++ c++ get first word of string find first char of string cpp c++ get the first character in a string get first char from string c++ how to get first character in std::string cpp get first char of string get the first caracter of a string c++ check the first letter of a string c++ access first character of string c++ get the first letter of each word in a string c++ from username get the first letter of each word in a string c++ c++ first character of string show first letter string c++ c++ string first character first character of string cpp how to find first character in string c++ c++ std string first character c++ std string first char get first word from string c++ find first of string c++ example find first of string c++ how to check first character of a string c++ get first character of string c++ how to get first and last letter of a string c++ how to print first letter of a string in c++ check which letter comes first c++ c++ at function capitalize first letter of string c++ how to get the first letter of a string in c++ c++ check first character std::string get first to characters of line c++ fuction that gives the firest digit from string c++ read up to particular character in string c++ how to remove first first letter in a string C++ get first char in string c++ first char in line c++ get char at index c++ c++ string access character getting the first character of a string in c++ c++ string index access c++ get first character of string how to get the first letter of a word in c++ how to get the first character of a string c++ getting first character in string c++ how to get a char from a string c++ return first inde of a character c++ get the first letter of a string c++ c++ string at string get first character c++ string.at c++ c++ at() how to check first letter of a string in C++ first character of a string C++ capitalize first letter of word c++ string indexing in c++ how to check if the first letter of a string c++ how to check if the first letter of a stringc++ get the 1st char from string c++ string find char at index c++ first character from string c++ c++ string get first get first letter of string c++ as string get first letter of string c++ first char of string c++ c++ how to get the first character of a string not digit first character of a string c++ print first character of string c++ how to take first char from a string c++ .at() c++ getting first character of a string c++ get first character of a vector c++ check first value of string c++ c++ take 1st letter string string indexing c++ string letter by letter cpp how to take the first char of a strign c++ gow to get the foirst element f a string in c++ check first char cpp string check if first character of a string is a letter c++ at of string in cpp how to get the first letter of string c++ how to get a single character from a string in c++ string indices c++ string character at position c++ check first letter of string c++ first letter of string
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source