on 02-15-2016 9:38 PM
local stringvar mystr := "UPDATE: A=5; oldA= 3,B=2; oldB= 3,C=4; oldC= 3";
local stringvar mystr1;
local stringvar output="";
If (mystr[1 to 6] like "UPDATE") then (
mystr1 := MID(mystr, INSTR(mystr, ":") + 2) ;
stringvar array allChanges := Split(mystr1,",");//this puts each line into individual array slots
Local NumberVar numOfChanges:=Ubound(allChanges);
Local NumberVar i:= 1 ;
Redim allChanges[numOfChanges];
While i <= numOfChanges Do
(
join(allChanges,',');
i := i + 1;
);
)
Above Function prints True.
I was expecting it to print :
A=5; oldA= 3
B=2; oldB= 3
C=4; oldC= 3
Hi Shradha,
This code should work:
local stringvar mystr := "UPDATE: A=5; oldA= 3,B=2; oldB= 3,C=4; oldC= 3";
If Left(mystr,6) = 'UPDATE' then
(
local stringvar array arr := split(MID(mystr, INSTR(mystr, ":") + 2), ',');
local stringvar fin := Join(arr, chr(13));
);
fin;
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.