6

*String response = "<I:BARCO@noiclt22815||K:CMS||O:REgetPerspectiveList||A0:googleP||A1:yahooP||A2:gmail||A3:test||>";*

When I put the above string in italics in one of my posts most of the code isn't displayed:

String response = "";

I removed the "<" from the response and then everything works as expected. Is "<" treated as a special character?

1 Answer 1

6

Yes.

In a nutshell, angle brackets < and > (but really more >) are regarded as HTML markup, so you must either escape them or place them inside of a <code> block.

There are limits to what HTML can be placed in an answer, but by and large, if you're representing code, you should look to place that between backticks (`).

With backticks, your variable would be: String response = "<I:BARCO@noiclt22815||K:CMS||O:REgetPerspectiveList||A0:googleP||A1:yahooP||A2:gmail||A3:test||>";, which renders correctly every time.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .