Expert Angular
上QQ阅读APP看书,第一时间看更新

String

The string data type can hold a sequence of characters. Declaring and initializing the string variable is very simple, as follows:

var authorName: string = "Rajesh Gunasundaram"; 

Here, we declared a variable named authorName as a string, and it is assigned the value Rajesh Gunasundaram. TypeScript supports surrounding the string value with either a double quotes (") or single quotes (').