Assume we have such strings.
const del = 'Deleted'
const str1 = 'clean.Deleted'
const str2 = 'get.clean.Deleted'
const str3 = 'cl.Deleted'
And I need return every time str1, str2,str3 without .Deleted
It is work for me:
any_string.substr(0, (any_string.length - del.length-1))
Do we have a more generic way?