modifying code to be more specific?
<p>My code removes consecutive duplicates in a string. What I want to do now is only have it remove specific duplicates. Example.. </p>

<pre><code>my_func("killkiss","l")
'kilkiss'
my_func("killkiss","s")
'killkis'
</code></pre>

<p>My code</p>

<pre><code>def my_func(input,sub):
newString = ""
for char in input:
    if newString == "" or char != newString[len(newString)-1]: #I've tried adding 'and is sub'
        newString += char    
return newString
</code></pre>

<p>Is there a way to modify my code? I need the practice so no built ins from string library or imports.</p>
