View Problem

Define a string containing special characters

Define the literal string "\#{'}${"}/"
DiskEdit
ruby
special = '\#{\'}${"}/'
ExpandDiskEdit
java
String special = "\\#{'}${\"}/";
DiskEdit
perl
$special = '\#{\'}${"}/';
DiskEdit
perl
$special = q(\#{'}${"}/);
ExpandDiskEdit
groovy
special = "\\#{'}\${\"}/"
ExpandDiskEdit
groovy
special = '\\#{\'}${"}/'
ExpandDiskEdit
groovy
special = /\#{'}${'$'}{"}\//
DiskEdit
groovy
assert '42'.isNumber()
ExpandDiskEdit
scala Java 1.5 or later
val special = "\\#{'}${\"}/"
val special2 = """\#{'}${"}/"""
DiskEdit
python
# yes, Python has way too many forms of string literals :)
print "\\#{'}${\"}/"
print "\\#{'}${"'"'"}/"
print r"""\#{'}${"}/"""
print '\\#{\'}${"}/'
print '\\#{'"'"'}${"}/'
print r'''\#{'}${"}/'''
ExpandDiskEdit
cpp
std::string special = "\\#{'}${\"}/";
ExpandDiskEdit
cpp C++/CLI .NET 2.0
String^ special = L"\\#{'}${\"}/";
ExpandDiskEdit
fsharp
let special = "\#{'}${\"}/"
ExpandDiskEdit
erlang
Special = "\\#{'}\${\"}/",
DiskEdit
ocaml
"\\#{'}${\"}/"
ExpandDiskEdit
csharp
string verbatim = @"\#{'}${""""}/";
string cStyle = "\\#{'}${\"\"}/";
ExpandDiskEdit
php
$special = "\\#{'}\${\"}/";
ExpandDiskEdit
php
$special = '\#{\'}${"}/';
DiskEdit
haskell
putStrLn "\"\\#{'}${\"}/\""
DiskEdit
haskell
let special = "\\#{'}${\"}/"
DiskEdit
clojure
(def special "\\#{'}${\"}/")
ExpandDiskEdit
fantom
special := Str<|\#{'}${"}/|>
ExpandDiskEdit
go
s := "\\#{'}${\"}/"
ExpandDiskEdit
go
s := `"\#{'}${"}/"`

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