2020年3月17日 星期二

[JS]子字串包含



const string = "foo";
const substring = "oo";

console.log(string.includes(substring));
=======================================================
ie support
var string = "foo";
var substring = "oo";

console.log(string.indexOf(substring) !== -1);

https://stackoverflow.com/questions/1789945/how-to-check-whether-a-string-contains-a-substring-in-javascript

沒有留言:

張貼留言

讓ASP.NET網站在開發除錯時期擁有WEB.CONFIG文件轉換功能

ref: https://blog.kkbruce.net/2016/09/enabling-xml-document-transforms-for-all-asp-net-web-by-develop-time.html#.XoP1KGMzbRY