i have the following string
msg~name~Text~
i am trying to parse them into parameters
the separator should be ~
so the result need
param[1] = msg
param[2] = name
param[3] = text
and so on i have been doing this in delphi by doing following
i have seen parsing example in the forum but here what i have tried
how to get N[1] N[2] N[3] ?
is it safe and correct to use Paramnum(0) and so on ?
msg~name~Text~
i am trying to parse them into parameters
the separator should be ~
so the result need
param[1] = msg
param[2] = name
param[3] = text
and so on i have been doing this in delphi by doing following
B4X:
DECODES := 'msg~name~Text~';
ParamsCount := 0;
while (DECODES <> '') do
begin
Inc(ParamsCount);
P := Pos('~', DECODES);
if P = 0 then
Params[ParamsCount] := DECODES
else
begin
Params[ParamsCount] := Copy(DECODES, 1, P - 1);
Delete(DECODES, 1, P);
end;
end;
i have seen parsing example in the forum but here what i have tried
B4X:
Dim param As String = msg
Dim paramnum () As String = Regex.Split("\~", param)
For Each n As String In paramnum
Log(n)
Next
how to get N[1] N[2] N[3] ?
is it safe and correct to use Paramnum(0) and so on ?