字符串截取的三種方式!

        let str = 'abcdef'; // 0     str = str. slice( 0); //返回整個字符串 abcdef str = str. substring( 0); //返回整個字符串 abcdef str = str. substr( 0); //返回整個字符串 abcdef // 使用一個參數 str = str. slice( 2); //截取第二個以後
相關文章
相關標籤/搜索