19 4 月 JS substring() 方法用於擷取兩個文字符(start, stop) Posted at 18:09h in JS筆記 by evcx86 0 Comments 0 Likes Share const str = ‘Mozilla’; console.log(str.substring(1, 3)); // expected output: “oz” //擷取第一個字元到第三個字元 console.log(str.substring(2)); // expected output: “zilla” //擷取2以後的字元 Tags: javascript, substring
Sorry, the comment form is closed at this time.