Skip to content

Tag Archives: cpp-string

We can use inbuilt strcpy() function to copy one string to other but here, this program copies the content of one string to another manually… Read More
Here, we will build a C++ program to convert strings to char arrays. Many of us have encountered the error ‘cannot convert std::string to char[]… Read More
In C++, std::substr() is a predefined function used for string handling. string.h is the header file required for string functions. The substring function is used for… Read More
This function finds the first character in the string s1 that matches any character specified in s2 (It excludes terminating null-characters). Syntax : char *strpbrk(const… Read More
A stringstream associates a string object with a stream allowing you to read from the string as if it were a stream (like cin). To… Read More
strcoll() is a built-in library function and is declared in <string.h> header file. This function compares the string pointed to by str1 with the one… Read More
In C++, strchr() is a predefined function used for finding the occurrence of a character in a string. It is present in cstring header file.… Read More
strcat() The strcat() function will append a copy of the source string to the end of destination string. The strcat() function takes two arguments: 1) dest 2)… Read More
In C/C++, strncat() is a predefined function used for string handling. string.h is the header file required for string functions.This function appends not more than… Read More
strrchr() function In C++, strrchr() is a predefined function used for string handling. cstring is the header file required for string functions.This function returns a pointer… Read More
isspace() function In C++, isspace is a predefined function used for string and character handling.cstring is the header file required for string functions and cctype… 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
In C++, isupper() and islower() are predefined functions used for string and character handling. cstring.h is the header file required for string functions and cctype.h… Read More
Given a string, extract all integers words from it. Examples : Input : str = "geeksforgeeks 12 13 practice" Output : 12 13 Input :… Read More

Start Your Coding Journey Now!