like in javascript

Solutions on MaxInterview for like in javascript by the best coders in the world

showing results for - "like in javascript"
Abigael
24 Aug 2017
1// Match a string that ends with abc, similar to LIKE '%abc'
2if (theString.match(/^.*abc$/)) 
3{ 
4    /*Match found */
5}
6
7// Match a string that starts with abc, similar to LIKE 'abc%'
8if (theString.match(/^abc.*$/)) 
9{ 
10    /*Match found */
11}
12