InputString: "I am unwell" "We need to go to the doctor" "How long will it take?"
.
OutputString: I am unwell We need to go to the doctor How long will it take?
The string needs to cleaned of all occurrences of the char "
. I can think of the following approacg
"
Repeat steps 1 and 2 , until strchr() returns a NULL pointer.
I feel this is very inefficient way to approach this problem. I need to know , if there are other methods to achieve this? Pseudo code or actual code will both be appreciated.
Delete All Occurrences of a Character From a String in Python Using the split() Method. We can also use the split() method to remove all the occurrences of a character from a given string. The split() method, when invoked on a string, takes a separator as its input argument.
You can also remove a specified character or substring from a string by calling the String. Replace(String, String) method and specifying an empty string (String. Empty) as the replacement.
for (s=d=str;*d=*s;d+=(*s++!='"'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With