有两种,一种是基本类型,一种是引用类型。
let gou:string='狗娃宝宝'
let gouwa:String=new String("gouwa.com")
console.log(gou);
console.log(gouwa);
console.log(gou.length);
console.log(gouwa.length);
// 1查找字符串 indexOf
let something:string = '清晨起来打开窗,心情很好'
let somestr:string = '心情'