On Thu, Feb 14, 2002 at 03:26:13PM +0530, Sreemathi_M wrote:
> hi,
> 
> i want to know how to replace a single \ (back slash)                  with
> single  / (forward slash) .
> 
> regards,
> sreemathi
---end quoted text---

Well the best way to know is to take some time and read some
documentation or books. 

A Short-term solution to your needs is this:

$_='s\s\s\s\s\s';       # the original string
print "$_\n";           # print the original string
s!\\!/!;                # use a regex (! used for clarity)
print "$_\n";           # show the changes.

I'm not even sure if this is exactly what you want.

You could have meant:
1) All instances of \ not \\    : s!\\([^\])!/$1!g; *
2) All instances of \           : s!\\!/!g;
3) One instances of \ not \\    : s!\\([^\])!/$1!; *
4) Only a single instances of \ : s!\\!/!;

I've opted for the latter (4).

The best advice I can _really_ give, and I hope it's not patronizing, is
to spend some time phrasing your question, quite often you'll find the
answer as you're writing the email; if not we're in a better postion to
help. It saves time in the end.

* not tested.
-- 
 Frank Booth - Consultant
Parasol Solutions Limited.
(www.parasolsolutions.com)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to