Js Check If String Contains Substring From End Of String