Horje
how to easily trim a str in c++ Code Example
how to easily trim a str in c++
#include <iostream>
using namespace std;

string trim(string value, int start, int end, int jump = 1) 
{
	string Newstr;
	for (int idx = start; idx <= (end - start) + 1; idx += jump)
	{
		Newstr += value[idx];
	}

	return Newstr;
}

int main()
{
	cout << trim("Mystring", 2, 5) << endl; //str
}




Cpp

Related
fatal error: opencv2/opencv.hpp: No such file or directory Code Example fatal error: opencv2/opencv.hpp: No such file or directory Code Example
check variable type c++ Code Example check variable type c++ Code Example
stack implementation using linked list in cpp Code Example stack implementation using linked list in cpp Code Example
qt messagebox Code Example qt messagebox Code Example
convert whole string to lowercase c++ Code Example convert whole string to lowercase c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8