in reply to Re: how insert back slash to a string that has only special characters or mixture of both
in thread unable to differentiate last word and intermediate word in a sentence
The quotemeta function do this.
$var="!@#$%^&(),.}{[]+-"; print "\n$var"; $var_with_slash=quotemeta($var); print"\n$var_with_slash";
|
|---|