Top "Stdstring" questions

std::string is the C++ standard library's byte-based "string" type, defined in the <string> header.

I want to convert std::string into a const wchar_t *

Is there any method? My computer is AMD64. ::std::string str; BOOL loadU(const wchar_t* lpszPathName, int flag = 0); When …

c++ stl wchar-t stdstring
What does string::npos mean in this code?

What does the phrase std::string::npos mean in the following snippet of code? found = str.find(str2); if (found != …

c++ stdstring c++-standard-library
Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’

At the top of my file I have #define AGE "42" Later in the file I use ID multiple times including …

c++ string c-preprocessor stdstring
Is it possible to use std::string in a constexpr?

Using C++11, Ubuntu 14.04, GCC default toolchain. This code fails: constexpr std::string constString = "constString"; error: the type ‘const string {aka …

c++11 stdstring constexpr
Remove First and Last Character C++

How to remove first and last character from std::string, I am already doing the following code. But this code …

c++ string stdstring erase-remove-idiom
How to check if a string contains a char?

I have a text file that I want to read. I want to know if one of the lines contains [ …

c++ stdstring
How to implode a vector of strings into a string (the elegant way)

I'm looking for the most elegant way to implode a vector of strings into a string. Below is the solution …

c++ string stl stdstring implode
map<string, string> how to insert data in this map?

I need to store strings in key value format. So am using Map like below. #include<map> using …

c++ stl stdstring stdmap
How to convert std::string to NSString?

Hi I am trying to convert a standard std::string into an NSString but I'm not having much luck. I …

objective-c nsstring objective-c++ stdstring
Padding stl strings in C++

I'm using std::string and need to left pad them to a given width. What is the recommended way to …

c++ string padding stdstring