#include <iostream>
#include <sstream>
bool replace(std::string& str, const std::string& from, const std::string& to) {
size_t start_pos = str.find(from);
if(start_pos == std::string::npos)
return false;
str.replace(start_pos, from.length(), to);
return true;
}
std::string Lcase(std::string& str)
{
int i;
std::string temp = "";
for(i = 0; i < str.length(); i++){
temp += tolower(str[i]);
}
return temp;
}
std::string Ucase(std::string& str)
{
int i;
std::string temp = "";
for(i = 0; i < str.length(); i++){
temp += toupper(str[i]);
}
return temp;
}
std::string Mid(std::string& str, int pos1, int pos2)
{
int i;
std::string temp = "";
for(i = pos1; i < pos2; i++){
temp += str[i];
}
return temp;
}
std::string Left(std::string& str, int pos)
{
int i;
std::string temp = "";
for(i = 0; i < pos; i++){
temp += str[i];
}
return temp;
}
std::string Right(std::string& str, int pos)
{
int i;
std::string temp = "";
for(i = pos; i < strlen(str.c_str()); i++)
{
temp += str[i];
}
return temp;
}
std::string joinString( const std::string & str, const std::vector< std::string > & seq )
{
std::vector< std::string >::size_type seqlen = seq.size(), i;
if ( seqlen == 0 ) return "";
if ( seqlen == 1 ) return seq[0];
std::string result( seq[0] );
for ( i = 1; i < seqlen; ++i )
result += str + seq[i];
return result;
}
void splitString(const std::string& s,std::vector<std::string>& sv,const char delim = ' ')
{
sv.clear();
std::istringstream iss(s);
std::string temp;
while (std::getline(iss, temp, delim))
sv.emplace_back(std::move(temp));
return;
}
//
void main()
{
std::vector<std::string> sv;
splitString(strValue.GetBuffer(), sv, ',');
string su = joinString(",", sv);
int a = 0;
}