<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">People already do this with the s1.replace(s2, "") idiom. I'm not sure what the added value is. Your equivalent implementation looks pretty strange and complex: how is it different from str.replace with the empty string as second argument?<div>
<br></div><div><br></div><div>cheers</div><div>lvh</div></span>