Skip to content

Tag Archives: cpp-strings-library

Parses string interpreting its content as a floating-point number, which is returned as a value of type float. Syntax : float stof (const string& str,… Read More
It searches the string for the first character, from the end of the string, that does not match any of the characters specified in its… Read More
Convert numerical value to string Syntax : string to_string (int val); string to_string (long val); string to_string (long long val); string to_string (unsigned val); string… Read More
std::find_first_of is used to compare elements between two containers. It compares all the elements in a range [first1,last1) with the elements in the range [first2,last2),… Read More
Comparing String using Relational operators, Using compare() Relational operators vs std::string::compare() Return Value : Relational operators return boolean value, while compare() returns unsigned integer. Parameters… Read More
std::basic_string::at, std::basic_string::operator[]Both at() and operator[] can be used to access an element in the string. But there exists one difference between them on how to… Read More
Returns a reference to the character at specified location pos. No bounds checking is performed. If pos > size(), the behavior is undefined. Syntax :… Read More
It searches the string for the first character that does not match any of the characters specified in its arguments. Here we will describe all… Read More
Finds the element in the given range of numbers. Returns an iterator to the first element in the range [first,last) that compares equal to val.… Read More
resize() lets you change the number of characters. Here are we will describe two syntaxes supported by std::string::resize() in C++ Return Value : None Syntax… Read More
Returns a reference to the character at the specified location pos. The function automatically checks whether pos is the valid position of a character in… Read More
insert() is used to insert characters in string at specified position. It supports various syntaxes to facilitate same, here we will describe them. Syntax 1:… Read More
std::basic_string::max_size is used to compute the maximum number of elements the string is able to hold due to system or library implementation limitations. size_type max_size()… Read More
The member function assign() is used for the assignments, it assigns a new value to the string, replacing its current contents. Syntax 1: Assign the value… Read More
This member function appends characters in the end of string. Syntax 1 : Appends the characters of string str. It Throws length_error if the resulting… Read More

Start Your Coding Journey Now!