Linked Questions
75 questions linked to/from How to convert an instance of std::string to lower case
2
votes
2
answers
1k
views
C++ - Sorting strings in a vector in a specific way
I'm currently attempting to sort strings in a vector, but I'm unsure on how to go about doing it a specific manner. The game engine I am working with requires strings to be sorted case-insensitively (...
0
votes
5
answers
2k
views
How do I check the end of a string in C++?
I have a rudimentary program I'm trying to implement that asks for a URL of a .pdf file and then downloads it and shows it through Xming. First, I want to check to make sure the user actually put in a ...
3
votes
2
answers
1k
views
Access elements of a char* and check value C++
I know you can access individual characters stored in a character array:
example[] = 'HeLlo";
for (int i = 0; i < 6; i++)
{
if (example[i] >= 65 || example[i] <= 90)
{
...
1
vote
1
answer
2k
views
Can't convert string to lower case
I'm trying to convert string to lower case, here is my program:
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
string a;
getline(...
2
votes
1
answer
3k
views
Portable conversion of std::string to std::wstring and vice versa?
I need to convert std::string to std::wstring. I have used something on below lines with visual studio 2010 (and it's working fine) :-
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>&...
4
votes
2
answers
2k
views
How do I use std::regex_replace to replace string into lowercase?
I find this regex for replacement Regex replace uppercase with lowercase letters
Find: (\w) Replace With: \L$1
My code
string s = "ABC";
cout << std::regex_replace(s, std::regex("(\\w)"), "\\...
1
vote
3
answers
220
views
C++ Code optimization
I have created my custom function to turn a wstring into lower case. However, it is pretty slow in DebugMode. Yes, I know ReleaseMode is what counts, but anyway it is pretty unnerving.
wstring ...
1
vote
2
answers
443
views
Convert normal iterator of characters to string
I am wondering how to convert iterator of characters __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > to string in C++?
#include <iostream>
#include <string&...
0
votes
2
answers
1k
views
How to manipulate a string to lower case and store in same variable
I have a piece of code that asks for user input, it is type "string" and its a really simple process, i want whatever the user inputs to be converted using the tolower() function. It does exactly as ...
0
votes
2
answers
1k
views
Convert all and any command line input to string in C++
I am trying to write a small code at the beginning of my program that runs different functions depending on the file extension of the files that are passed when calling the program from the command ...
1
vote
3
answers
238
views
C++ replace function
I am trying to use the replace function to replace uppercase letters with lowercase ones. The way I was trying to do it was that when the letter being checked is between ASCII values 65-90, it would ...
1
vote
3
answers
172
views
What does it mean in C++ when you have a parameter like ::lower? [duplicate]
On S.O. posts such as How to convert std::string to lower case?, I've seen the syntax ::something, e.g.
std::transform(data.begin(), data.end(), data.begin(), ::tolower);
and I'm wondering what that ...
1
vote
2
answers
847
views
Could not find a match for 'std::transform..."
I have this weird error where the code was working before but after some time it stopped compiling.
The error is:
Could not find a match for 'std::transform<InputIterator,OutputIterator,...
2
votes
3
answers
507
views
What's an easy way to compare case insensitively of strings? [duplicate]
Trying to compare strings using:
!(stringvector[i]).compare(vector[j][k])
only works for some entries of
vector[j][k]
-- namely ones that are a case sensitive string match.
How do I get case-...
0
votes
1
answer
986
views
Choosing encoding for icu::UnicodeString
I found myself in need of a way to change a string to lower case that was safe to use for ASCII and for UTF16-LE (as found in some windows registry strings) and came across this question: How to ...