java跨行
發布時間: 2023-08-27 11:12:41
❶ java中的讓字元串跨行符號是什麼
你說的意思:
.net中:
stringquery=@"SELECTfoo,bar
FROMtable
WHEREid=42";
php中
<?php
$str=<<<'EOD'
Exampleofstring
spanningmultiplelines
usingnowdocsyntax.
EOD;
echo<<<'EOT'
Mynameis"$name".Iamprintingsome$foo->foo.
Now,Iamprintingsome{$foo->bar[1]}.
Thisshouldnotprintacapital'A':x41
EOT;
?>
這種跨行書寫,不用在每句話的後面添加+
groovy:
assert'''hello,
world'''=='hello, world'
//triple-quotesformulti-linestrings,adds' 'regardlessofhostsystem
assert'hello,
world'=='hello,world'//
java中有沒有?沒有
熱點內容