Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Move the position of the multiline string
#5
Add a blank line and the output will change

I think using regular expressions to solve the problem would be more generic. 


Macro M1
Code:
Copy      Help
out
_s=
;using namespace Spire.Doc;
;
;using namespace Spire.Doc.Documents;
;
;function Main([string[]]$args)
;{
;,function D($p1)
;,{
;,,'{D}'
;,}
;}
;
;function A($p1, $p2)
;{
;,'{A}'
;}
;
;function B($p1)
;{
;,'{B}'
;}
;
;function C()
;{
;,'{C}'
;}

;Todo:  Move the position of the multiline string (function Main)
str s ss
int i ii lines
foreach s _s
,if(ii=2) break
,if(!s.len)
,,ii+1
,if(ii=1)
,,ss.addline(s -1)
,,lines+1
,i+1
_s.RemoveLineN(i-lines-1 lines)
ss- "[]"; ss.rtrim
_s.addline(ss -1)
out _s


Messages In This Thread
RE: Move the position of the multiline string - by Davider - 10-22-2022, 05:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)