Navigate back to the homepage

How to check a substring in a string in typescript?

Infinitbility
TypeScript
November 8th, 2021 · 1 min read
How to check a substring in a string in typescript?

Hello Friends 👋,

Welcome To Infinitbility! ❤️

This tutorial will help you to check substring is present or not in a string using typescript syntax examples. here we are using the .includes() method to check substring available in string.

Let start today tutorial How to check a substring in a string in typescript?

The .includes() method return true and false based on string avalablity.

Let create the first example string and substring variable with data.

1let str: string = "We have the ability to build infinite way for us --infinitbility";
2let subStr: string = "build";

For check substring in a string let use the .includes() method.

1str.includes(subStr); // true

output

includes, typescript, Example

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

Tutorials

Categories

More articles from Infinitbility

How to check array is empty in typescript?

How to check array is empty in typescript?

Example of check array is empty or not in typescript

November 7th, 2021 · 1 min read
How to check array contains value in typescript?

How to check array contains value in typescript?

Example of check array contains value or not in typescript

November 6th, 2021 · 1 min read
© 2020–2021 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]