The question now is how to decompose, the return value may be 3 or 4 of article, how to decompose @ @ space mark, thank you.
CodePudding user response:
Ls_tmp=upper (message. Stringparm + "|")
The DO WHILE TRUE
Li_pos=pos (ls_tmp, "|")
IF li_pos & gt; 0 THEN
I + +
Ls_e [I]=left (ls_tmp, li_pos - 1)
Ls_tmp=mid (ls_tmp, li_pos + 1)
The CONTINUE
END the IF
The EXIT
LOOP
==========================================================
CodePudding user response:
//get the delimiter separated after array
1://parameters should be delimited string
2://parameters separated output array
3://parameter delimiters
Returns an array of upper limit of//
String as_text='XXXXX @ @ XXXXXXX @ @'
String as_sep='@ @'
Long li_pos=0, li_startpos=1, I=0, l_len, li_lastpos
Int l_lensep
String ls_empty []
Ls_ret=ls_empty [] []
L_len=len (as_text)
L_lensep=len (as_sep)
Li_pos=pos (as_text as_sep)
//normal intercept
Do the while (li_pos & gt; 0)
I++
Ls_ret [I]=mid (as_text li_startpos, li_pos - li_startpos)
Li_lastpos=li_pos
Li_startpos=li_lastpos + l_lensep
Li_pos=pos (as_text as_sep, li_startpos)
Loop
If l_len & gt;=li_startpos then
I++
Ls_ret [I]=mid (as_text li_startpos)
End the if
The return I
CodePudding user response:
My own with a, under reference,//according to such as return order code refs array
/* adopts the intercept method to extract */
The integer l_i, l_ii []
String s_values [], s_value
S_value=https://bbs.csdn.net/topics/trim (mle_value)
For l_i=1 to Lena (trim (mle_value))
L_ii [l_i]=pos (trim (s_value), ', ')
If l_ii [l_i] & gt; 0 then
S_values [l_i]=mid (s_value, 1, l_ii [l_i] 1)
s_value=https://bbs.csdn.net/topics/right (s_value, len (s_value) - (len (s_values [l_i]) + 1))
The else
L_i=Lena (trim (mle_value))
End the if
Next
Return s_values []
CodePudding user response:
//according to such as return order code refs array
/* adopts the intercept method to extract */
The integer l_i, l_ii []
String s_values [], s_value
S_value=https://bbs.csdn.net/topics/trim (mle_value)
For l_i=1 to Lena (trim (mle_value))
L_ii [l_i]=pos (trim (s_value), ', ')
If l_ii [l_i] & gt; 0 then
S_values [l_i]=mid (s_value, 1, l_ii [l_i] 1)
s_value=https://bbs.csdn.net/topics/right (s_value, len (s_value) - (len (s_values [l_i]) + 1))
The else
L_i=Lena (trim (mle_value))
End the if
Next
Return s_values []
CodePudding user response:
By means of interception field make loop processing