Typescript Strings

Typescript Literal types String, Boolean, Number & Enum
TypeScript

Typescript String, Boolean, Number & Enum Literal types

TypeScript Literal Types restrict the value of a variable to finite valid values. The latest version of Typescript supports the following Literal Types. String Literal Types,Numeric Literal Types,Boolean Literal Types & Enum Literal Types. This is very useful feature which restrict the possible values, that you can store in a variable

Typescript Tagged Templates
TypeScript

Typescript Tagged Templates

The Typescript Tagged Templates allow us to tag template strings or template literals. Once tagged, the Templates strings allow us to parse the template literals using a function. It allows us more control over how the templates are converted to a string.

Template Strings, String interpolation & multi-line Typescript
TypeScript

Template Strings, String interpolation & multi-line Typescript

Template literals (or Template strings ) in Typescript are multiline string literals allowing embedded expressions. You can use multi-line strings, basic string formatting, string interpolation & tagged templates with them. They are part of ES2016/ES6 specification. Template literals are also called as template strings. In this tutorial, we will learn the Template Literals syntax and how to use it in Multi line Strings & string interpolation. We will also learn how to nest expressions and how to Escaping template literals using the backslash (\)

Typescript String
TypeScript

TypeScript String

We use Typescript string to store the textual data. It is a primitive data type in typescript. We enclose string data in double-quotes (“) or single quotes (‘). We can also define them using the Template literal syntax or back-tick. Such strings are called Template strings, The Template strings can be used to create multi-line strings, strings with embedded expressions & Tagged Template strings. The Typescript also has a String object, which is a wrapper around a primitive string. In this tutorial, we learn about typescript strings. We also find out the difference between String vs string. Finally, we also look at the list of typescript string functions.

Scroll to Top