BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

How to split a group of words?

Anonymous
Not applicable
example:
test="中文English123"
Change into

test1="中文"
test2="English"
test3= "123"
1 REPLY 1
Karl Ottenstein
Moderator
Parsing or breaking up a string into words is easier if there is a space or punctuation symbol between words, but in your case the split or parse is based on finding a character that is not in the same set as the first character that you want matched/grouped. Same type of process though.

You have to program this with a loop that iterates through the string and builds an array of the parsed/matched words from your original string. GDL is very close to the old BASIC language - not exactly, but close enough. You can find many examples on the web of parsing strings.

You want to look at the GDL Reference Manual, in the chapter Expressions and Functions > String Functions
One of the forum moderators
AC 27 USA and earlier   •   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Learn and get certified!