Skip to content

Tag Archives: cpp-strings-library

In C/C++, strcat() is a predefined function used for string handling, under string library (string.h in C, and cstring in C++). This function appends the… Read More
Ropes are scalable string implementation. They are designed for efficient operation that involves the string as a whole. Operations such as assignment, concatenation, and sub-string… Read More
What is string::npos: It is a constant static member value with the highest possible value for an element of type size_t. It actually means until… Read More
Given a string S and a character C, the task is to remove all the occurrences of the character C from the given string. Examples:… Read More
Using inbuilt function: strcpy(): Using the inbuilt function strcpy() from string.h header file to copy one string to the other. strcpy() accepts a pointer to… Read More
Given a String str containing only lowercase English alphabets and an integer K. The task is to check that whether the string can be converted… Read More
Given three strings(without spaces). The task is to print the new string after modifying the three given string as follows:   Replace all the vowels present… Read More
Given a string and an integer M, print all distinct circular strings of length M in lexicographical order.  Examples:  Input: str = “baaaa”, M =… Read More
Member functions String.constructor :  Construct string object (public member function ). String.destructor : String destructor (public member function ) String.operator= : String assignment (public member… Read More
In C++, std::strstr() is a predefined function used for string handling. string.h is the header file required for string functions. This function takes two strings… Read More
Memset() is a C++ function. It copies a single character for a specified number of times to an object. It is useful for filling a… Read More
std::strncmp() function lexicographically compares not more than count characters from the two null-terminated strings and returns an integer based on the outcome. This function takes… Read More
In this article, we are going to inspect three different ways of initializing strings in C++ and discuss differences between them. 1. Using char* Here,… Read More
C++ STL offers many utilities to solve basic common life problems. Comparing values are always necessary, but sometimes we need to compare the strings also.… Read More
std::string::at can be used to extract characters by characters from a given string. It supports two different syntaxes both having similar parameters: Syntax 1:   char& string::at (size_type… Read More

Start Your Coding Journey Now!