If for some reason you can't use the net package, get the Perl5Util from
www.oroinc.com and just:

yourURL = perl.substitute("s/\\s/%20/g", yourURL );

cheers.

-mark

-----Original Message-----
From: blueads.com [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 09, 2000 12:04 AM
To: [EMAIL PROTECTED]
Subject: Space Character In URL


- I am running into the same problem as another poster had with spaces in a
URL. I have tried replacing the space with a '+' sign using the code below.
This worked fine with Internet Explorer but Not with Netscape.

// String phrase needs '+' signs between spaces for http links.

int length = phrase.length();
String temp = phrase;
char linkPhrase[] = temp.toCharArray();

for (int i = 0; i < length; i++) {
        if(linkPhrase[i] == ' '){
                linkPhrase[i] = '+';
        }
}

- Someone suggested that using %20 works. How would I implement it based on
the sample code above?

Thanks,

Tom K.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to