|
-
Jan 16th, 2004, 07:05 AM
#1
Thread Starter
Lively Member
spaces in strings trimmed automatically when passing to applet??
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
-
Jan 16th, 2004, 08:33 AM
#2
Try writing the parameter as " - ".
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 16th, 2004, 09:21 AM
#3
Thread Starter
Lively Member
  doesnt work, but you pointed to the right direction
it's
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
-
Jan 16th, 2004, 01:41 PM
#4
Dazed Member
So when you pass a string constructed with leading and trailing spaces it's trimmed? Strange.
Code:
public String X(){
String delim = new String(" " + "-" + " ");
StringBuffer result = new StringBuffer("3333");
result.insert(2,delim);
return result.toString();
}
Last edited by Dilenger4; Jan 16th, 2004 at 01:45 PM.
-
Jan 16th, 2004, 02:53 PM
#5
No, I think the issue is with <param> elements as parameters to an applet.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 16th, 2004, 04:55 PM
#6
Dazed Member
Ah ok. Must be the browser then.
-
Jan 17th, 2004, 08:27 AM
#7
Thread Starter
Lively Member
yes, its the browser that does that.
Weird thing i sthat its documented nowhere.. (at least not as far as i looked )
Remvs
-
Jan 17th, 2004, 09:43 AM
#8
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.
Last edited by CornedBee; Jan 17th, 2004 at 09:52 AM.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 17th, 2004, 03:58 PM
#9
Thread Starter
Lively Member
Like i said,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|