"blueads.com" wrote:
>
> - 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?
>
I had similar problems and resolved the. as follows:
mystring.replace(' ', '_');

whic worked fine for me

sven


--
-------------------------------------------------------------------------------------------
Sven E. van 't Veer                                                Afiliado
Universo Online
Gerente Desenvolvimento
Brasil Inform�tica e Telecomunica��es Ltda.
http://www.brvip.com.br
http://www.uol.com.br
-------------------------------------------------------------------------------------------

___________________________________________________________________________
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