⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vb6strfunctocpp.cpp

📁 VB6 has two very useful string functions: Join and Split. This code implements Join and Split functi
💻 CPP
字号:
// VB6strFuncToCPP.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include "MFCstring.h"
using namespace NotMFC;

#include "VB6functions.h"
using namespace VB6;

using namespace std;

int main(int argc, char* argv[])
{
  vector<CString> ss,fs; long i;
	CString s1 = "Key", s2="Value";
	ss.push_back(s1);
	ss.push_back(s2);
	//ss.push_back("Default");
	CString out = Join(ss,"=");
	printf("Join: %s,%s -> %s\n\n",s1.c_str(),s2.c_str(),out.c_str());

	CString sMulti = "Name,Surname,Address,Tel";
	fs = Split(sMulti,",");

	printf("Split: %s (%d items)\n",sMulti.c_str(),fs.size());
  for(i=0; i<fs.size(); i++)
		printf("%s\n",fs[i].c_str());

	CString f1 = "Filip";
	CString f2 = Replace(f1,"F","Ph");
	printf("\nReplace example: %s -> %s\n",f1.c_str(),f2.c_str());
	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -