4

Is it possible to make method chaining in a new line, like you can do in C#?

var foo = bar
  .MethodOne()
  .MethodTwo()
Michael J. Barber
  • 24,518
  • 9
  • 68
  • 88
Emil C
  • 1,315
  • 4
  • 15
  • 27

2 Answers2

4

whitespace is not significant inside () so the following is legal boo code:

a = (bar
     .Foo()
     .Bar())
2

You should use '\' symbol. See sample:

a = 123 \
       .ToString() \
       .Length
print a
Sergey Mirvoda
  • 3,209
  • 2
  • 26
  • 30