Navigate back to the homepage

how to add double quotes in string in typescript?

Infinitbility
TypeScript
July 17th, 2022 · 1 min read
how to add double quotes in string in typescript?

Add double quotes in string in typescript

To add double quotes in the string in typescript, use double quotes both side with the + operator it will concatenate the string and return a new string with double quotes like below example.

1let str: string = "infinitbility";
2
3// add double quotes
4str = '"' + str + '"';
5console.log(str) // 👉️ '"infinitbility"'

Add double quotes at the beginning of string in typescript

To add double quotes at the beginning of string in typescript, use double quotes at starting of the string with the + operator it will concatenate the string and return a new string with double quotes like below example.

1let str: string = "infinitbility";
2
3// add double quotes
4str = '"' + str;
5console.log(str) // 👉️ '"infinitbility'

To show space at the beginning of the string you should put a double quotes string before the + operator, like in the above example.

Add double quotes at the end of the string in typescript

To add double quotes at the end of string in typescript, use the + operator with a double quotes string it will concatenate the string and return a new string with space.

1let str: string = "infinitbility";
2
3// add double quotes
4str = str + '"';
5console.log(str) // 👉️ 'infinitbility"'

To show add double quotes at the end of string you should put a double quotes string after the + operator, like in the above example.

I hope it helps you, All the best 👍.

Follow me on Twitter

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide

Tutorials

Categories

More articles from Infinitbility

node-red dropdown example

node-red dropdown example

Example of dropdown in node-red with step by step guide.

July 17th, 2022 · 1 min read
node-red environment variables example

node-red environment variables example

Example of environment variables in the node-red with step-by-step guide.

July 17th, 2022 · 1 min read
© 2020–2022 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]