Results 1 to 9 of 9

Thread: spaces in strings trimmed automatically when passing to applet??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    The Netherlands
    Posts
    112

    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

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    The Netherlands
    Posts
    112
    &#32 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

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  6. #6
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Ah ok. Must be the browser then.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    The Netherlands
    Posts
    112
    yes, its the browser that does that.
    Weird thing i sthat its documented nowhere.. (at least not as far as i looked )


    Remvs

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    The Netherlands
    Posts
    112
    Like i said,
    Code:
    NOT DOCUMENTED

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width