I understand that str = str.replace('x', '') will eliminate all the x's.
But let's say I have a string jxjrxxtzxz
and I only want to delete the first and last x making the string jjrxxtzz
. This is not string specific. I want to be able to handle all strings, and not just that specific example.
edit: assume that x is the only letter I want to remove. Thank you!