Hello everyone,
I want to achieve the same effect in QM as powershell code,
Included: Arrays reverse order, and splitting one line of strings
Code Description:
Split the last line of string from where the first # character,
All Lines, in reverse order, then merged together with spaces between, Final after the #character is placed at the end(keep #)
The end result:
I'm in the third line I'm the second line I'm in the first line #foo #ball
Powershell execution is slow, using QM should be faster,
Thanks for any advice and help
david
Macro Macro7
Powershell code:
I want to achieve the same effect in QM as powershell code,
Included: Arrays reverse order, and splitting one line of strings
Code Description:
Split the last line of string from where the first # character,
All Lines, in reverse order, then merged together with spaces between, Final after the #character is placed at the end(keep #)
The end result:
I'm in the third line I'm the second line I'm in the first line #foo #ball
Powershell execution is slow, using QM should be faster,
Thanks for any advice and help
david
Macro Macro7
out
_s =
;I'm in the first line
;I'm the second line
;I'm in the third line #foo #ball
;todo: split The third line of the string, separator # keep #
ARRAY(str) a
a=_s
a.sort(1) ;;Reverse order does not take effect
str d
for _i 0 a.len
,d.formata("%s " a[_i].trim)
out d
Powershell code: