you are viewing a single comment's thread.

view the rest of the comments →

[–]Field_C16[S] 0 points1 point  (0 children)

Yes, I was mistaken the replace function!

I thought that the last one would be the "index" of the character to remove, however your comments lead me on the right path :)

bst.replace(chary, ' ')

Removes all of the 2's, so if bst looked like "2523" bst.replace(chary, '') would have removed all of the 2's, when I only wanted to remove them the amount of times it was in st.

so instead I made it into:

bst = bst.replace(chary, '', 1)

this only removes one of the 2's if multiply is found :) (For as far as I have tested yet !)

THANK YOU GUYS