Results 1 to 3 of 3

Thread: Placeholder

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Resolved Placeholder

    Is there something like this? Like

    string str=string.Format("I am {0}","nebulom"); in C# where "nebulom" is the first argument and placed in the place holder marked {0}. Or....

    printf("%s","Hello"); in C... I need help. Thanks.
    Last edited by nebulom; May 30th, 2005 at 09:41 PM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Placeholder

    Oh, my bad. Sorry for posting. Never thought it looks like C.

    String s=String.format("I am %s","nebulom");

    Anyway, just don't wanna delete this as someone might find it useful.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Placeholder

    String.format is one option, and a rather new one (Java 5). Before that, there was java.text.MessageFormat.
    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.

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