尊龙凯时人生就是博

jsÖÐÔõÑù»»ÐÐ

ʹÓà “\n” תÒå×Ö·ûʵÏÖ»»ÐÐ £¬¿Éͨ¹ý (1) ÔÚ×Ö·û´®ÖÐʹÓà “\n”£»(2) ʹÓÃÄ£°åÎÄ×Ö (`)£»(3) ʹÓà “multiline” ÊôÐÔ£»»ò (4) ʹÓà ascii »»Ðзû (10)¡£

ÔõÑùÔÚ JavaScript Öл»ÐÐ

ÔÚ JavaScript ÖÐ £¬»»ÐпÉÒÔʹÓà “\n” תÒå×Ö·ûʵÏÖ¡£

ʹÓà “\n” תÒå×Ö·û

×î¼òÆÓµÄÒªÁìÊÇÔÚ×Ö·û´®ÖÐÖ±½ÓʹÓà “\n” תÒå×Ö·û£º

const str = "µÚ 1 ÐÐ\nµÚ 2 ÐÐ";
console.log(str);

µÇ¼ºó¸´ÖÆ

Õ⽫Êä³öÁ½ÐÐÎı¾ £¬¸÷Õ¼Ò»ÐС£

ʹÓà Template Literals

Ò²¿ÉÒÔʹÓÃÄ£°åÎÄ×ÖÀ´ÊµÏÖ»»ÐÐ £¬Ê¹Ó÷´ÒýºÅ (`) ¶ø²»Êǵ¥ÒýºÅ»òË«ÒýºÅ£º

const str = `µÚ 1 ÐÐ
µÚ 2 ÐÐ`;
console.log(str);

µÇ¼ºó¸´ÖÆ

ÕâÒ²»áÊä³öÁ½ÐÐÎı¾¡£

ʹÓà multiline ÊôÐÔ

¹ØÓÚ¶àÐÐ×Ö·û´® £¬¿ÉÒÔÔÚ×Ö·û´®Ç°Ãæ¼ÓÉÏ “multiline” ÊôÐÔ£º

const str = `
µÚ 1 ÐÐ
µÚ 2 ÐÐ`;
console.log(str);

µÇ¼ºó¸´ÖÆ

ÕâÑùÒ²¿ÉÒÔÊä³öÁ½ÐÐÎı¾ £¬²¢ÇÒ´úÂëÔ½·¢ÇåÎú¡£

ÆäËûÒªÁì

ÉÐÓÐÆäËûÒªÁì¿ÉÒÔʵÏÖ»»ÐÐ £¬µ«ËüÃDz»Ì«³£Óãº

ʹÓà ASCII »»Ðзû (10)£º¿ÉÒÔ½« ASCII »»Ðзû (Ê®½øÖÆ 10) ת»»Îª×Ö·û £¬µ«½öÔÚijЩÇéÐÎÖÐÊÜÖ§³Ö¡£

ʹÓà CSS£º¿ÉÒÔʹÓà CSS µÄ “white-space” ÊôÐÔÀ´ÉèÖû»Ðзû £¬µ«ÕâÒ²½öÊÊÓÃÓÚ HTML ÇéÐΡ£

ÒÔÉϾÍÊÇjsÖÐÔõÑù»»ÐеÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ