Linked Questions
75 questions linked to/from How to convert an instance of std::string to lower case
17
votes
6
answers
64k
views
Convert a single character to lowercase in C++ - tolower is returning an integer
I'm trying to convert a string to lowercase, and am treating it as a char* and iterating through each index. The problem is that the tolower function I read about online is not actually converting a ...
5
votes
4
answers
3k
views
How to write my own manipulator?
Let's suppose I want to write my own manipulator for input and output.
cin >> mymanip >> str;
or
cout << mymanip << str;
What I want that mymanip does is toggle case the ...
3
votes
4
answers
3k
views
How to achieve unicode-agnostic case insensitive comparison in C++
I have a requirement wherein my C++ code needs to do case insensitive comparison without worrying about whether the string is encoded or not, or the type of encoding involved. The string could be an ...
-1
votes
1
answer
9k
views
If else statement using upper and lower case letters
So I am having troubles. My professor wants me to write a basic program that adds up costs and outputs the rate for a cable company based if its a residential package or a business package using if ...
0
votes
4
answers
11k
views
C++ How do I read in a file, convert each word to lower case and then cout each word?
I am having trouble getting started with a program. I need to read in each word from a file, then convert it to lower case. I would like to std::cout each word after I find it. I assume I need to use ...
0
votes
2
answers
6k
views
Input validation loop in C++ with strings
I'm just learning C++ (1 week of experience) and was trying to write an input validation loop that ask the user to enter "Yes" or "No". I figured it out but have a feeling there's a better way of ...
0
votes
2
answers
6k
views
C++: Find matching characters in character array
How do I implement a c++ script to search a group of characters from an character array.The search characters are not case sensitive.For an example, I key in "aBc" and the character array has "abcdef" ...
1
vote
4
answers
1k
views
Use of an iterator when comparing two wstring
I am iterating through a list and through a vector. Both are filled with wstring s.
I need to compare the two strings they are pointing at and find out if "wstring1" exists in another "wstring2".
n ...
0
votes
5
answers
2k
views
c++ small capital letter no difference
I have method that find occurrences of string in other string. My question is how to make it to do no difference between small and capital letter?
int occurrences = 0;
string::size_type start = 0;
...
2
votes
6
answers
3k
views
How to order strings case-insensitively (not lexicographically)?
I'm attempting to order a list input from a file alphabetically (not lexicographically). So, if the list were:
C
d
A
b
I need it to become:
A
b
C
d
Not the lexicographic ordering:
A
C
b
d
I'm ...
1
vote
2
answers
9k
views
How to perform case insensitive string comparison? [duplicate]
in this code i'm comparing between two strings i did it correctly, but i don't want to consider the letters' case.
for ex: first string: aaaa, second string: aaaA. the output should be 0 or equal.
...
3
votes
3
answers
4k
views
Simple Password Encryption for school assignment
Okay, so I'm building a program for a college class, it's a simple program that uses structures to simulate building a database of user information along with usernames and passwords. For extra ...
9
votes
0
answers
4k
views
boost::algorithm::to_upper/to_lower ok for utf8? boost::locale not necessary?
I've read in several places that boost::algorithm::to_upper/to_lower are not ok for utf8:
http://www.boost.org/doc/libs/1_51_0/libs/locale/doc/html/conversions.html
How to convert std::string to lower ...
1
vote
1
answer
3k
views
Elements in a string vector to lower case
I am using one vector of strings and the strings are not in lower case. I want them to covert to lower case.
For converting string to lower case, I am using following method.
std::transform(...
0
votes
2
answers
877
views
find an word in vector<string> cocos2d-x
I have an vector word_list, and i want to find an word in word_list. I use function
bool Mylayer::existWord(vector<string> word_list, string word)
{
if (std::lower_bound(word_list.begin(), ...