Skip to content

cotrVarStringMulti

Creates a multi-line string variable

Aliases:

  • cotrVarStringMulti
  • multiLineString
  • varStringMulti
  • stringVariableMulti
  • createMultiLineString

cpp

std::string myString = R"(Your multi-line message here)";

csharp

string myString = @"""
Line 1
Line 2
Line 3
""";

dart

String myString = '''
Your string here
''';

haskell

let myString = """
Line 1
Line 2
Line 3
"""

kotlin

var myString = """
Line 1
Line 2
Line 3
"""

perl

mymyString = <<'END_STRING';
Line 1
Line 2
Line 3
END_STRING

powershell

Terminal window
myString = @"
Line 1
Line 2
Line 3
"@;

python

myString = '''
Line 1
Line 2
Line 3
'''

r

my_string <- paste0(
{2:"Line 1",
{3:"Line 2",
{4:"Line 3")

ruby

my_string = <<~HEREDOC
Your string here
HEREDOC

rust

let myStr = String::from(
'Line 1'
'Line 2'
'Line 3'
);

scala

val myString = """
Line 1
Line 2
Line 3
"""

shellscript

Terminal window
# Use a here document for multi-line strings:
myString<<EOF
Line 1
Line 2
Line 3
EOF

swift

var myString = """
Line 1
Line 2
Line 3
""";

typescript

let myString: string = `
Line 1
Line 2
Line 3
`;

typescriptreact

let myString: string = `
Line 1
Line 2
Line 3
`;