文字列はシングルクオート( ' )かダブルクオート ( " )で囲みます。両者は全く等価です。シングル・ダブルクオートのどちらの場合でも ¥t (タブ), ¥n (改行) などの特殊文字を利用することができます。他のスクリプト系言語にある,変数展開などの便利な機能はありません。
文字列の基本操作サンプルコードです。
文字列操作のサンプルコードです。
文字列の基本操作サンプルコードです。
console.log('abc¥ndef'); //¥または\でエスケープ console.log('abc\ndef'); console.log('abc¥tdef'); //¥または\でエスケープ console.log('abc\tdef'); console.log("'hogehoge'"); console.log('"ほげホゲ"'); console.log('¥u0068¥u006f¥u0067¥u0065¥u0068¥u006f¥u0067¥u0065'); //unicode
文字列操作のサンプルコードです。
コメント
コメントを投稿