| | |
substitute a string
![]() |
•
•
Join Date: Apr 2008
Posts: 102
Reputation:
Solved Threads: 2
i am reading a url and inthat i have an array that has stored the value of a string as follows
some one please give me the code to write this as the output i want...
Perl Syntax (Toggle Plain Text)
address=no+3%2C+oxford+street in this wat i want is to display the address as "no 3 oxford street"
some one please give me the code to write this as the output i want...
Local P ...
There are other ways, but here is one:
Perl Syntax (Toggle Plain Text)
my $string = 'address=no+3%2C+oxford+street'; (my $key,$value) = split(/=/,$string); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; print $value;
•
•
Join Date: Apr 2008
Posts: 102
Reputation:
Solved Threads: 2
•
•
•
•
There are other ways, but here is one:
Perl Syntax (Toggle Plain Text)
my $string = 'address=no+3%2C+oxford+street'; (my $key,$value) = split(/=/,$string); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; print $value;
it worked thanks !!
Local P ...
![]() |
Similar Threads
- Question (Oracle)
- C++ Programming issue (C++)
- Storing a Template String? (Python)
- Removing found chars from string (C)
- substitute of sizeof operator (C++)
Other Threads in the Perl Forum
- Previous Thread: perl beginner question
- Next Thread: generating 'infinite' strings
| Thread Tools | Search this Thread |





