Saturday, November 16, 2024
HomeiOS DevelopmentPasting quoted code completely — Erica Sadun

Pasting quoted code completely — Erica Sadun

[ad_1]

You might have some code that you must incorporate right into a multi-line string. What’s the quickest and finest strategy to deal with it? Though I see folks do that on a regular basis, manually including areas to every line isn’t one of the best answer.

Right here’s a fast Xcode tip:

  • First, paste your materials into scope. Retain the indentation through the use of Edit > Paste and Protect Formatting.
  • Subsequent, in case you haven’t positioned them already, add the project and triple-quotes above and beneath the pasted materials.
  • Choose your materials and use Editor > Construction > Shift-Proper (Command-]) to line up the left fringe of the textual content with the closing triple-quote. This command strikes all chosen materials n areas to the precise, relying on the way you’ve arrange your tabbing. There’s an identical Shift-Left in case you indent slightly an excessive amount of.

Hope this helps somebody.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments