// 字符串string
let str='sajjsajjsa'
//一, includes检测某字符串是否存在某个值存在返回true不存在返回false
let zhi1= str.includes('l');//false
console.log(zhi1);
zhi1=str.includes('s');
console.log(zhi1);//true
// 二,startsWith()检测字符串开头是否是某值
let a3=str.startsWith('a');
console.log(a3);//false
a3=str.startsWith('s');
console.log(a3);//true
//三判断一个字符串是否是另一个字符串的末尾
let a4=str.endsWith('s');
console.log(a4);//false
a4=str.endsWith('a');
console.log(a4);//true
// 四,repeat返回一个新字符串表示将原字符串输出n次,重复0次则为空,个数如果为小数则向下取整,负数报错
let a5=str.repeat(4);//循环的个数
console.log(a5);
// 如果是小数则向下取整
a5=str.repeat(4.5);//循环的个数
console.log(a5);
// 五,padStart('判断字符串的个数','需要补全的字符串')用于头部补全形成新的字符串
let str1='12';
let a6=str1.padStart(4,'0');
console.log(a6);
// 六,padStart('判断字符串的个数','需要补全的字符串')用于末尾补全形成新的字符串
let a7=str1.padEnd(5,'le');
console.log(a7);