Skip to Content
Dismiss
Innovation
A platform built for AI

Unified, automated, and ready to turn data into intelligence.

Find Out How
Dismiss
June 16-18, Las Vegas
Pure//Accelerate® 2026

Discover how to unlock the true value of your data. 

Register Now
Dismiss
NVIDIA GTC San Jose 2026
Experience the Everpure difference at GTC

March 16-19 | Booth #935
San Jose McEnery Convention Center

Schedule a Meeting

What Is YAML and Can You Write Multiline Strings?

YAML is short for “yet another markup language” or “YAML ain’t markup language,” the latter recursive acronym being used to emphasize that YAML is for data and not documents. YAML is a data serialization language used to write configuration files for deployment of infrastructure. For example, if you want to deploy a Docker application to Kubernetes, you would use a YAML file to configure the instance. YAML is human-readable, so it’s easy to create a file and read instructions from it during deployments.

If you’re new to YAML, it won’t be long before you realize you need a way to break up your strings into multiple lines, one of the most frequently asked YAML questions on the web. In this article, we’ll cover the two main approaches to YAML multiline strings, as well as some other frequently asked questions.

YAML and Whitespace: What to Know

YAML files use whitespaces and carriage returns, but the content is serialized when ingested into a specific resource. Developers creating a YAML file can format text using indents and spacing to make it easier to read. YAML treats whitespaces similarly to other languages, so you can have as many as needed to format a file.

How to Break Lines for YAML Multiline Strings

When ingesting YAML files, you might occasionally want to keep the line breaks in a multiline string. Take the following pseudocode as an example:

    key:

            item1

            item2

            item3

After every line item (e.g., item1, item2, and item3), you have a carriage return. If you leave the YAML syntax as is, the string becomes the following:

item1 item2 item3

This string format creates one long string without any carriage return formatting, so you might want to preserve the line breaks. Line breaks can be preserved with the literal operator. The literal operator is the pipe (“|”) character. To preserve line breaks, your YAML syntax should be changed to the following:

    key: |

            item1

            item2

            item3

Notice the pipe character after the “key” directive. When the application ingests the YAML file, it will convert to the following string:

item1\nitem2\nitem3

The “\n” character represents a new line. Printing this string to an application will display each item with an appended carriage return to preserve the formatting in the YAML instructions.

YAML Multiline Blocks vs. Long Strings

For long strings, you need to use multiline blocks to read a YAML file. For example, if you have a 250-word paragraph in a YAML file, you need to break the sentences into multiline blocks. You wouldn’t want to preserve the carriage returns except at the end of a paragraph. You can format a YAML file to use multiple lines for long strings and serialize the string to append spaces to each item instead of a new line character. 

To use a whitespace character instead of appending a new line, use the folded (“>”) operator:

    key: >

            item1

            item2

            item3

With the folded operator, YAML adds a space when it creates the string. The string looks like the following:

item1 item2 item3\n

YAML Multiline FAQs

How do you insert a line break in YAML?

Using the literal operator (“|”), any line breaks in a YAML string will be preserved. You create a line break using the carriage return keystroke in the same way that you create a line break in a standard document. The following example preserves the carriage return in a YAML string:

    key: |

            item1

            item2

            item3

Can YAML have blank lines?

Yes, a string represented as a block of text can also contain blank lines. The keep operator (“|+”)  preserves any blank empty lines along with the new line character. The following YAML is an example of a multiline string with two empty lines at the end of the block:

    key: |+

            item1

            item2

            item3

A YAML parser will display the following string from the above syntax:

item1\nitem2\nitem3\n\n

Does YAML care about whitespace?

A tab whitespace is an illegal character in YAML, so any indents must be used with a standard single space character. Tabs can be used in quoted strings, but they cannot be used to format a YAML file. Consistency in whitespace indents is important for readability of data.

Are spaces allowed in YAML?

Yes, you can have standard spaces throughout a YAML file. Spaces should be used for indents and not the tab character. Tab characters could cause errors during the parsing of a YAML file.

10/2025
Virtual Machine Provisioning at Enterprise Scale | Everpure
Sizing and scaling Red Hat OpenShift Virtualization with Portworx.
White Paper
22 pages

Browse key resources and events

TRADESHOW
Pure//Accelerate® 2026
June 16-18, 2026 | Resorts World Las Vegas

Get ready for the most valuable event you’ll attend this year.

Register Now
PURE360 DEMOS
Explore, learn, and experience Everpure.

Access on-demand videos and demos to see what Everpure can do.

Watch Demos
VIDEO
Watch: The value of an Enterprise Data Cloud

Charlie Giancarlo on why managing data—not storage—is the future. Discover how a unified approach transforms enterprise IT operations.

Watch Now
RESOURCE
Legacy storage can’t power the future

Modern workloads demand AI-ready speed, security, and scale. Is your stack ready?

Take the Assessment
Your Browser Is No Longer Supported!

Older browsers often represent security risks. In order to deliver the best possible experience when using our site, please update to any of these latest browsers.

Personalize for Me
Steps Complete!
1
2
3
Personalize your Everpure experience
Select a challenge, or skip and build your own use case.
Future-proof virtualisation strategies

Storage options for all your needs

Enable AI projects at any scale

High-performance storage for data pipelines, training, and inferencing

Protect against data loss

Cyber resilience solutions that defend your data

Reduce cost of cloud operations

Cost-efficient storage for Azure, AWS, and private clouds

Accelerate applications and database performance

Low-latency storage for application performance

Reduce data centre power and space usage

Resource efficient storage to improve data centre utilization

Confirm your outcome priorities
Your scenario prioritizes the selected outcomes. You can modify or choose next to confirm.
Primary
Reduce My Storage Costs
Lower hardware and operational spend.
Primary
Strengthen Cyber Resilience
Detect, protect against, and recover from ransomware.
Primary
Simplify Governance and Compliance
Easy-to-use policy rules, settings, and templates.
Primary
Deliver Workflow Automation
Eliminate error-prone manual tasks.
Primary
Use Less Power and Space
Smaller footprint, lower power consumption.
Primary
Boost Performance and Scale
Predictability and low latency at any size.
What’s your role and industry?
We've inferred your role based on your scenario. Modify or confirm and select your industry.
Select your industry
Financial services
Government
Healthcare
Education
Telecommunications
Automotive
Hyperscaler
Electronic design automation
Retail
Service provider
Transportation
Which team are you on?
Technical leadership team
Defines the strategy and the decision making process
Infrastructure and Ops team
Manages IT infrastructure operations and the technical evaluations
Business leadership team
Responsible for achieving business outcomes
Security team
Owns the policies for security, incident management, and recovery
Application team
Owns the business applications and application SLAs
Describe your ideal environment
Tell us about your infrastructure and workload needs. We chose a few based on your scenario.
Select your preferred deployment
Hosted
Dedicated off-prem
On-prem
Your data centre + edge
Public cloud
Public cloud only
Hybrid
Mix of on-prem and cloud
Select the workloads you need
Databases
Oracle, SQL Server, SAP HANA, open-source

Key benefits:

  • Instant, space-efficient snapshots

  • Near-zero-RPO protection and rapid restore

  • Consistent, low-latency performance

 

AI/ML and analytics
Training, inference, data lakes, HPC

Key benefits:

  • Predictable throughput for faster training and ingest

  • One data layer for pipelines from ingest to serve

  • Optimised GPU utilization and scale
Data protection and recovery
Backups, disaster recovery, and ransomware-safe restore

Key benefits:

  • Immutable snapshots and isolated recovery points

  • Clean, rapid restore with SafeMode™

  • Detection and policy-driven response

 

Containers and Kubernetes
Kubernetes, containers, microservices

Key benefits:

  • Reliable, persistent volumes for stateful apps

  • Fast, space-efficient clones for CI/CD

  • Multi-cloud portability and consistent ops
Cloud
AWS, Azure

Key benefits:

  • Consistent data services across clouds

  • Simple mobility for apps and datasets

  • Flexible, pay-as-you-use economics

 

Virtualisation
VMs, vSphere, VCF, vSAN replacement

Key benefits:

  • Higher VM density with predictable latency

  • Non-disruptive, always-on upgrades

  • Fast ransomware recovery with SafeMode™

 

Data storage
Block, file, and object

Key benefits:

  • Consolidate workloads on one platform

  • Unified services, policy, and governance

  • Eliminate silos and redundant copies

 

What other vendors are you considering or using?
Thinking...
Your personalized, guided path
Get started with resources based on your selections.