PDA

Click to See Complete Forum and Search --> : spaces in strings trimmed automatically when passing to applet??


remvs
Jan 16th, 2004, 06:05 AM
hi all,

i've noticed that when passing String parameters to an Applet the string is trimmed automatically!

Is there a way to avoid this from happening?

i want to pass a delimiting string between to the applet to use between two other strings. so the delimiting string might look like:
" - "
And the spaces in the beginning and at the end should be there!!

Please help

Thanks a loft in advance

Remvs
from Holland

CornedBee
Jan 16th, 2004, 07:33 AM
Try writing the parameter as " - ".

remvs
Jan 16th, 2004, 08:21 AM
doesnt work, but you pointed to the right direction

it's
& nbsp;

that represents a space in HTML , and that works.
This makes me conclude thats its the Browser that trims the string, not the Java Applet


Thanks for the help!

remvs

Dillinger4
Jan 16th, 2004, 12:41 PM
So when you pass a string constructed with leading and trailing spaces it's trimmed? Strange. :sick:

public String X(){
String delim = new String(" " + "-" + " ");
StringBuffer result = new StringBuffer("3333");
result.insert(2,delim);
return result.toString();
}

CornedBee
Jan 16th, 2004, 01:53 PM
No, I think the issue is with <param> elements as parameters to an applet.

Dillinger4
Jan 16th, 2004, 03:55 PM
Ah ok. Must be the browser then. :D

remvs
Jan 17th, 2004, 07:27 AM
yes, its the browser that does that.
Weird thing i sthat its documented nowhere.. (at least not as far as i looked :wave: )


Remvs

CornedBee
Jan 17th, 2004, 08:43 AM
Look in the HTML specs.

Edit: I looked myself. Can't find anything, neither in the general HTML specs on attributes, nor in the <param> spec. Can't find anything in the java.applet package either.

remvs
Jan 17th, 2004, 02:58 PM
:p Like i said,

NOT DOCUMENTED