JavaScript Strings (基礎篇) | Compbrother Ltd

JavaScript Strings (基礎篇)


Web Design Expert!

Compbrother  @ Web Design : JavaScript Strings (基礎篇)

Publish Date: 2021-12-06

Article Type: Web Design

String字串是非常常見的資料類型(data type),而在JavaScript程式語言當中,String字串更帶給了我們很多便利和功用性,現在先和大家說說基礎篇!

從JavaScript中定義String字串:
single quote 方法: 例如 let classmate = 'Peter Leung';
double quotes 方法: 例如 let classmate = "Peter Leung";

String字串長度檢測:
text(被定義String字串名稱).length;

從字串中加入特別符號:
\" 可以在double quotes String字串中加入 "符號
\' 可以在single quote String字串中加入 '符號
\\ 可以在 String字串中加入 \符號
\b 可以在 String字串中加入空格(Backspace)
\n 可以在 String字串中加入新一行(New Line)
等等...



If you want the service of Web Design, do contact us immediately!



Contact



Send a Message

Sed diam nonummy nibh euismod tincidunt ut laoreet dolore magnais.