Mihir
Mihir

Reputation: 8734

How to search a part of the string in a whole string in javascript

Hello all i have string like (Attribute)-Company_02. in this i have to find the first occurrence of (Attribute)-. How to achieve this?

Thank you, Mihir

Upvotes: 0

Views: 337

Answers (1)

Aleadam
Aleadam

Reputation: 40381

Use myString.indexOf("(Attribute)-")

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/indexOf

Upvotes: 1

Related Questions