JSFiddle - React, Tailwind, and code Playground

JavaScript

let str1 = "asbf_000"
let str2 = "asbf"

console.log(str1.contains(str2));