Separating String Data

Separating String Data

__ANON_USER__1
Not applicable
251 Views
1 Reply
Message 1 of 2

Separating String Data

__ANON_USER__1
Not applicable

[ FlexSim 22.1.0 ]

Hello FlexSim Support Team,

Could you please tell me how I can separate this text data and put it in a global table column wise using Flexscript?For example: ABCD/EFGH/IJKL so I want ABCD in column 1st and EFGH in column 2nd and IJKL in column 3rd.



0 Likes
Accepted solutions (1)
252 Views
1 Reply
Reply (1)
Message 2 of 2

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You can use string.split() to split a string into an array using "/" as the delimiter:

string text = "ABCD/EFGH/IJKL";
Array cols = text.split("/");
Table table = Table("GlobalTable1");
for (int i = 1; i <= cols.length; i++)
    table[1] = cols;


Matthew Gillespie
FlexSim Software Developer