Typescript-string-length
提供:Dev Guides
TypeScript-文字列の長さプロパティ
文字列の長さを返します。
例
var uname = new String("Hello World")
console.log(uname)
console.log("Length "+uname.length) //returns the total number of characters
//including whitespace
コンパイル時に、JavaScriptで同じコードが生成されます。
その出力は次のとおりです-
Hello World
Length 11