Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple lines of text are split and assigned to multiple variables
#5
This looks like a bugĀ 

The result should be:
Key 1|-|Hello 1|World 1|

My understanding is wrong, I just found the help documentation:
Note that delim is not a delimiter string. It is a set of possible delimiter characters

Macro Macro6
Code:
Copy      Help
out
_s=
;Key 1
;-
;Hello 1
;World 1
;---
;Key 2
;-
;Hello 2
;
;World 2
;---
;Key 3
;-
;Hello 3
;World 3

_s.findreplace("[]" "|")
out _s
ARRAY(str) a
tok(_s a -1 "---")
out a[0]

It would be nice to have a split function like #1 with the same functionality as PowerShell


Messages In This Thread
RE: Multiple lines of text are split and assigned to multiple variables - by Davider - 11-21-2022, 12:20 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)