View Problem

Define a multiline string

Define the string:
"This
Is
A
Multiline
String"
ExpandDiskEdit
ruby
text = <<"HERE"
This
Is
A
Multiline
String
HERE
ExpandDiskEdit
ruby
text = "This\nIs\nA\nMultiline\nString"
ExpandDiskEdit
java
String text = "This\nIs\nA\nMultiline\nString";
ExpandDiskEdit
java
String text =
"This\n" +
"Is\n" +
"A\n" +
"Multiline\n" +
"String"
DiskEdit
perl
$text = 'This
Is
A
Multiline
String';
DiskEdit
perl
$text = <<EOF;
This
Is
A
Multiline
String
EOF
DiskEdit
groovy
def text =
"""This
Is
A
Multiline
String"""
DiskEdit
groovy
def text = "This\nIs\nA\nMultiline\nString"
DiskEdit
scala
val text = """This
Is
A
Multiline
String"""
ExpandDiskEdit
scala Java 1.5 or later
val text = "This\nIs\nA\nMultiline\nString"
DiskEdit
python
text = """This
Is
A
Multiline
String"""
DiskEdit
python
# with proper indentation
text = (
"This\n"
"Is\n"
"A\n"
"Multiline\n"
"String"
)
ExpandDiskEdit
cpp
std::string text =
"This\n"
"Is\n"
"A\n"
"Multiline\n"
"String";
ExpandDiskEdit
cpp C++/CLI .NET 2.0
String^ text = L"This\nIs\nA\nMultiline\nString";
ExpandDiskEdit
cpp
std::string text = "This\nIs\nA\nMultiline\nString";
ExpandDiskEdit
fsharp
let multiline = "This\nIs\nA\nMultiline\nString"
ExpandDiskEdit
fsharp
let multiline = "This
Is
A
Multiline
String"
ExpandDiskEdit
erlang
Text = "This\nIs\nA\nMultiline\nString",
DiskEdit
ocaml
"This\nIs\nA\nMultiline\nString"
DiskEdit
ocaml
"This
Is
A
Multiline
String"
ExpandDiskEdit
csharp
string output = "This\nIs\nA\nMultiline\nString";
DiskEdit
csharp
string output = @"This
Is
A
Multiline
String";
ExpandDiskEdit
php
$multiline = <<<ML
This
Is
A
Multiline
String
ML;
ExpandDiskEdit
php
$multiline = "This
Is
A
Multiline
String";
ExpandDiskEdit
php
$multiline = "This\nIs\nA\nMultiline\nString";
DiskEdit
haskell
s = "This \
\Is \
\A \
\Multiline \
\String"
DiskEdit
clojure
(def multiline "This\nIs\nA\nMultiline\nString")
ExpandDiskEdit
fantom
s := "This
Is
A
Multiline
String"
ExpandDiskEdit
go
text := "This\nIs\nA\nMultiline\nString\n"
ExpandDiskEdit
go
text := "This\n" + "Is\n" + "A\n" + "Multiline\n" + "String\n"
ExpandDiskEdit
go
var s = `This
Is
A
Multiline
String`

Submit a new solution for ruby, java, perl, groovy ...