Linked Questions
75 questions linked to/from How to convert an instance of std::string to lower case
2 votes
1 answer
13k views
C++ convert word in type string variable to lowercase [duplicate]
For sake of simplicity i chose to use a type 'string' instead of 'char'. But i am supposed to lowercase the string that i read in from the input file. I did not know at the time i would not be able to ...
-4 votes
3 answers
8k views
How to make case sensitivity not matter when inputting an answer? [duplicate]
so I'm learning programming and I understand variables, if else statements, cin and cout. So for a starter project I'm just creating a console application that asks the user questions, such as age, ...
0 votes
1 answer
2k views
How do you make a string lowercase (the easy way)? (C++) [duplicate]
I am building a program that takes input, then detects to see it a specific thing was entered. After the line was entered,it should convert it to lowercase. But, I cannot figure out how. I have tried ...
0 votes
3 answers
500 views
function for converting string case? [duplicate]
is there a single function in c++ that converts strings from lowercase to uppercase and vice versa? I need to compare two strings case insensitive and I can only convert one of the strings and the ...
1 vote
2 answers
542 views
how to convert lower case strings to upper case strings in c++ [duplicate]
how can i make this program to accept both upper and lower case id's. The id when read from file is of upper case.The id's present are in the form of S2345. Help please. cout << "Enter ...
1 vote
0 answers
547 views
Convert a `std::filesystem::path` to all lower case [duplicate]
I want to convert a std::filesystem::path to all lowercase so I can find files of a given extension, "dsf". #include <filesystem> #include <iostream> int main() { const std::...
0 votes
1 answer
481 views
Convert String Array Elements to lowercase [duplicate]
Is there a way to convert strings inside an array into lowercase? So say I have an array like: String mainArray[] = {"Dog", "caT", "ElepHANT", "Hungry", "LION"} // So mainArray[0] = "Dog" ...
-2 votes
1 answer
220 views
How to make each letter in a string not case sensitive [duplicate]
I'm learning C++ right now, but I can't seem to find out how to make an input be accepted whether or not there are any capitals anywhere. For example, if someone input "sAndwiCh" in a case in a switch ...
0 votes
2 answers
97 views
Canonicalizing the case of a word entered by the user [duplicate]
I am building a console bot. There is a way to specify the gender of the user there. Now if the user gives the command !setgender then the gender of the user will be asked by the bot. My question is ...
-2 votes
1 answer
149 views
C++ help related to Upper and Lower cases [duplicate]
I want the code to search for a word mid sentence and see if its first letter is lower case. If it is, than it makes it upper case. For example: John hates using c++ daily, and it would change the C ...
3 votes
0 answers
94 views
Make *it in lowercase [duplicate]
im not really good in c++ so i wondering if someone can help me with this. std::vector<std::string> vocations; for(VocationsMap::iterator it = Vocations::...
318 votes
10 answers
662k views
For every character in string
How would I do a for loop on every character in string in C++?
36 votes
5 answers
28k views
Why can't "transform(s.begin(),s.end(),s.begin(),tolower)" be complied successfully?
Given the code: #include <iostream> #include <cctype> #include <string> #include <algorithm> using namespace std; int main() { string s("ABCDEFGHIJKL"); transform(s....
34 votes
3 answers
170k views
error: strcpy was not declared in this scope
I get this problem in a c++ problem compiling in Ubuntu g++ version 4.4.3. I dont know the headers to include to solve this problem.. Thanks centro_medico.cpp: In constructor ‘Centro_medico::...
33 votes
3 answers
54k views
'colon' and 'auto' in for loop c++? need some help understanding the syntax
I need some explanation for the following c++ syntax: for(const auto& ioDev : deviceList) given that: std::vector<Device *> deviceList Specifically, I am confused about ':' and the usage ...