Search
 
SCRIPT & CODE EXAMPLE
 

CPP

find substring after character

// CPP program to illustrate substr()
#include <string.h>
#include <iostream>
using namespace std;
 
int main()
{
    // Take any string
    string s = "dog:cat";
 
    // Find position of ':' using find()
    int pos = s.find(":");
 
    // Copy substring after pos
    string sub = s.substr(pos + 1);
 
    // prints the result
    cout << "String is: " << sub;
 
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to find common divisors of two numbers in cpp 
Cpp :: check .h files syntax c++ 
Cpp :: int and char in c++ compiler 
Cpp :: c++ dynamic array 
Cpp :: cout alternative c++ 
Cpp :: why wont a function stop C++ 
Cpp :: sort vector in descending order c++ 
Cpp :: sideways triangle c++ xy plane 
Cpp :: qpushbutton clicked connect c++ 
Cpp :: create dynamic variable c++ 
Cpp :: cout two dimension array c++ 
Cpp :: integrate sinx 
Cpp :: c++ int max value 
Cpp :: convert c++ to c language 
Cpp :: delay without blocking 
Cpp :: sort using comparator anonymous function c++ 
Cpp :: statement that causes a function to end in c++ 
Cpp :: flutter container margin 
Cpp :: determining a string is subsequence of another 
Cpp :: avl tree c++ 
Cpp :: 136. Single Number leetcode solution in c++ 
Cpp :: stp 
Cpp :: how to know how many numbers i deleted with erase command on multiset c++ 
Cpp :: Patrick and Shopping codeforces in c++ 
Cpp :: Define and show the implementation of the functions of an arrayList. 
Cpp :: C++ How to insert and print array elements? 
Cpp :: racing horses codechef solution c++ 
Cpp :: string class cpp 
Cpp :: frac{2}{5}MR^2 typed in c++ 
Cpp :: split date and time in a column in db browser 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =