Usually I would expect a str.includes()
method, but there doesn't seem to be one in TypeScript.
Asked
Active
Viewed 3,890 times
0

Irina
- 786
- 1
- 11
- 25
-
Check this answer: [https://stackoverflow.com/questions/6629728/check-if-a-string-has-a-certain-piece-of-text](https://stackoverflow.com/questions/6629728/check-if-a-string-has-a-certain-piece-of-text) – Oram Jun 21 '18 at 10:08
-
The first variant: let test = 'Hello World'; if(test.indexOf('World') >= 0){ // Found world } helped. Thank you – Irina Jun 21 '18 at 10:13