Skip to Content

How to Use & (Ampersand) in Text

I have a TextView object in a Web Dynpro Java program that contains text which includes the ampersand (&) character.  However, the ampersand is converted to '&' when my text is displayed.

How do I get just the ampersand (&) to display in my text?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 26, 2012 at 04:39 PM

    where you get the text?

    have you tried to debug your code?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member W. Scott Klingensmith

      Scott, the "&" you see only at design time, but at run time there is a plain ampersand character in text, isn't it? And is there a problem? 😊

  • Jun 27, 2012 at 12:23 PM

    hi Scott,

    I think it will be easier to replace your '&' with 'and' 😊 ! else you will have to link the text with a context attribute and populate the context attribute with the requisite string in wdDoInit() method and as Sergei rightly pointed above, this problem does not happen at run time.

    Text & Text - at design time


    Text & Text - looks perfectly as it is supposed to be at run time.

    Thanks and Regards,

    -Amol Gupta

    Add comment
    10|10000 characters needed characters exceeded