摘要:
今天在网上找了一下,发觉有比较多的方法,现在列出来,需要的朋友可以参考一下。功能最丰富的就是第一种方法了:1 vector<string> Split(const string& s,const string& match,bool removeEmpty=false,bool fullMatch=false) 2 //参数s为需要肢解的字符串 3 //参数match为肢解匹配字符串 4 //参数removeEmpty为是否删除空字符 5 //参数fullMatch为是否只保留全匹配的字符串 6 7 下面为代码区: 8 #include <string> 阅读全文
摘要:
#include "stdafx.h" using namespace System; //这个命名空间如果缺的话,IntPtr这个无法识别int main(array<System::String ^> ^args) { char* ch1 = "this is chars "; //将char*转换为System::String^ String^ str1= System::Runtime::InteropServices::Marshal::PtrToStringAnsi((IntPtr)ch1); //System::String^转 阅读全文