MessageFormat with apostrophe's

Discussion in 'Java' started by Panda, Sep 2, 2003.

  1. Panda

    Panda Guest

    I'm trying to use MessageFormat with text that has apostrophe's.

    My text is

    Payé depuis le début de l''année, exercice financier {0}


    but MessageFormat isn't returning the text with the apostrophe -
    instead I get
    Payé depuis le début de lannée, exercice financier 2003 (after the
    substitution)

    My call in the code is :

    MessageFormat.format(lm.getLabel(50923, userLangLower),currentYrArray)

    I'm wondering if anyone else has had this problem and if so how do I
    format the initial text before passing it in to the MessageFormat.

    I tried - Payé depuis le début de l''année, exercice financier '{'0}
    like the javadoc implied but that didn't work.

    Thanks.
    Panda, Sep 2, 2003
    #1
    1. Advertising

  2. Panda

    Roedy Green Guest

    On 2 Sep 2003 13:32:32 -0700, (Panda)
    wrote or quoted :

    >Payé depuis le début de l''année, exercice financier {0}


    try \' instead of '' if this starts out as a Java string literal.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Sep 2, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. paul reed
    Replies:
    0
    Views:
    415
    paul reed
    Oct 17, 2003
  2. Replies:
    3
    Views:
    3,354
  3. Jon A. Cruz

    Re: MessageFormat boolean and hex

    Jon A. Cruz, Aug 9, 2003, in forum: Java
    Replies:
    2
    Views:
    1,719
  4. Ittay Dror
    Replies:
    1
    Views:
    429
    Ittay Dror
    Jul 29, 2004
  5. spring MessageFormat

    , Feb 8, 2006, in forum: Java
    Replies:
    0
    Views:
    1,713
Loading...

Share This Page