# String String 全局对象是一个用于字符串或一个字符序列的构造函数。 字符串字面量采取以下形式: ```ts 'string text' "string text" "中文/汉语" "español" "English " "हिन्दी" "العربية" "português" "বাংলা" "русский" "日本語" "ਪੰਜਾਬੀ" "한국어" ``` ## 实例属性 ### length ## 实例方法 ### toString() ### includes(searchString, position?) ### endsWith(searchString, endPosition?) ### repeat(count) ### startsWith(searchString, position?) ### at(index) ### charAt(pos) ### charCodeAt(index) ### concat(...strings) ### indexOf(searchString, position?) ### lastIndexOf(searchString, position?) ### localeCompare(that) ### match(regexp : string | RegExp) : RegExpMatchArray | null; ### replace(searchValue, replaceValue) ### replace(searchValue, replacer) ### search(regexp) ### slice(start?, end?) ### split(separator, limit?) ### substring(start, end?) **bug&tips** 当前版本android平台 start 与 end 参数声明为Int, 需要将number 参数转换为int ```uts let a = 1 let b = 2 // 临时解决办法 "hello uts".substring(a.toInt(),b.toInt()) ``` 这个问题后续会修复 ### toLowerCase() ### toLocaleLowerCase(locales?) ### toUpperCase() ### toLocaleUpperCase(locales?) ### trim() ### substr(from, length?) ### padStart(targetLength, padString?) ### padEnd(targetLength, padString?) ### codePointAt(pos) ### normalize(form) ### normalize(form?) ### isWellFormed() ### toWellFormed() ### toCharArray() ### valueOf() ### anchor(name) ### big() ### blink() ### bold() ### fixed() ### fontcolor(color) ### fontsize(size) ### fontsize(size) ### italics() ### link(url) ### small() ### strike() ### sub() ### sup() ## 静态方法 ### fromCharCode(...codes : number[]):string ## Android 平台实现 * 目前 string 类型编译到 kotlin 为 kotlin.String