SwiftUI Email message body - line or carriage return?

Hi all,

I am trying to get the "Time on: 1244" "Time in: 1248" and "Fuel on board: 1.9" to show up on separate lines in the email message body generated by my SwiftUI App.

I tried using a "+" between each but that didn't work...

MailView(result: self.$result, newSubject: "Arrival Report - TEST", newMsgBody: "Time on: (onTime)" + "Time in: (inTime)" + "Fuel on board: (fuelRemaining)")

      Any suggestions?

Thanks for your time.

Replies

Did you try "\n"?

As in:

"Line 1\nLine 2\nLine 3"

Or:

"Time on: \(onTime)\nTime in: \(inTime)\nFuel on board: \(fuelRemaining)"

Not sure how to incorporate your suggestion actually. Can you show me how to use "\n" in my String?

Thanks for your quick reply.

Thanks!

Did the trick.

Really appreciate this.

Cheers.