|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Special characters
I'm trying to remove the " from a form input.
Here's the code if($FORM{'title'} =~ "\""){ $FORM{'title'} =~ s|\"|"|g; print "<br>$FORM{'storytitle'}"; } It doesn't seem to work. Can anyone help |
|
#2
|
|||
|
|||
|
if($FORM{'title'} =~ "\""){
$FORM{'title'} =~ s|\"|"|g; print "<br>$FORM{'storytitle'}"; } if($FORM{'title'} =~ /\"\"\"/){ $FORM{'title'} =~ s/\"//g; print "<br>$FORM{'storytitle'}"; } Not sure what your looking for in the if but this finds when $FORM{'title'} is """ and then gets rid of the quotes. |
|
#3
|
||||
|
||||
|
Of you could shorten it by:
Code:
if ($FORM{'title'} =~ s/"//g) {
print "<br>$FORM{'storytitle'}";
}
This strips all "s if there are any. If not, the if loop fails and it won't print anything. ~ishnid |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Special characters |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|