Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ get string between two characters

string str = "STARTDELIMITER_0_192.168.1.18_STOPDELIMITER";
unsigned first = str.find(STARTDELIMITER);
unsigned last = str.find_last_of(STOPDELIMITER);
string strNew = str.substr (first,last-first);
std::cout << strNew << std::endl;
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to split a string in c++ 
Cpp :: c++ vectors 
Cpp :: detect end of user input cpp 
Cpp :: debugging c/c++ with visual studio code 
Cpp :: run cmd command c++ 
Cpp :: string to uint64_t c++ 
Cpp :: c++ vector initialization 
Cpp :: function c++ 
Cpp :: c++ code for bubble sort 
Cpp :: concat two vectors c++ 
Cpp :: continue statement in c++ program 
Cpp :: case label in c++ 
Cpp :: how to append to a vector c++ 
Cpp :: quick sort c+++ 
Cpp :: union of two arrays leetcode 
Cpp :: c++ get line 
Cpp :: Setting a number of decimals on a float on C++ 
Cpp :: integer to char c++ 
Cpp :: c++ add two char together 
Cpp :: letter occurrence in string c++ 
Cpp :: sort vector from largest to smallest 
Cpp :: c++ string slicing 
Cpp :: inserting element in vector in C++ 
Cpp :: ++ how to write quotation mark in a string 
Cpp :: map in c 
Cpp :: long pi in c++ 
Cpp :: c++ math 
Cpp :: take a function as an argument in c++ 
Cpp :: convert wchar_t to to multibyte 
Cpp :: loop execution descending order in c++ 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =