impala 字符串分割
- 作者: 施主淫得一手好湿
- 来源: 51数据库
- 2020-09-30
//************************************ // Member Name : SplitByPara3 // FullName : SplitByPara3 // Function Description : 字符串分割函数 // Parameter Specification // string strsrc :呆分割字符串 // char ch :分隔符字符串 // vector & :分割后字符串存放容器 // 所需头文件 sstream.h string.h //************************************ void SplitByPara3(const string strsrc,vector &vec_output,const char ch) { istringstream is(strsrc); string strtmp; while(getline(is,strtmp,ch)) { if (strtmp == "") { continue; } vec_output.push_back(strtmp); } } 例子 vector dt; SplitByPara3(",dsads",dt);
亲 , 用split函数 分割字符串得到数组
private?sub?command1_click()
????dim?s?as?string
????s?=?"123456----hdahdkahd----2013.1.1"
????dim?a
????a?=?split(s,?"----")
????if?isarray(a)?then
????????text1.text?=?a(1)
????end?if
end?sub
亲 , 用split函数 分割字符串得到数组
private?sub?command1_click()
????dim?s?as?string
????s?=?"123456----hdahdkahd----2013.1.1"
????dim?a
????a?=?split(s,?"----")
????if?isarray(a)?then
????????text1.text?=?a(1)
????end?if
end?sub
推荐阅读
