I have managed to extract data from a flat text file, put it into a string but have discovered that it holds some extra characters it shouldn't have:
%-%% dotted about the string (produced by a perl script) How do I remove the %-%% from the string without writing back to the file (I open it as read only because it's ownership belongs to the perl script)
I have managed to strip out the %-%% by
$description = preg_replace("/[[:alnum:]]/", " ", $description);
Trouble is it replaces them with spaces so I get 4 spaces where they were the %-%%. How do I get rid of the extra spaces without killing all spaces?????
Any help appreciated