字符串str = “AA BB CC DD”
能不能把字符串按空格拆分成数组,然后取出来使用
------解决方案--------------------
string as_parm, as_data[], as_format
long ll_pos, ll_item
as_parm = "AA BB CC DD"
as_format = " "
if isnull(as_parm) then
as_parm = ''
end if
if len(as_parm) <= 0 then
return 0
end if
if isnull(as_format) then
as_format = ''
end if
if len(as_format) <= 0 then
return 0
end if
ll_item = 0
ll_pos = pos(as_parm, as_format)
do while ll_pos > 0
ll_item ++
as_data[ll_item] = left(as_parm, ll_pos - 1)
as_parm = mid(as_parm, ll_pos + len(as_format))
ll_pos = pos(as_parm, as_format)
loop
ll_item ++
as_data[ll_item] = as_parm