Make a plus sign in java string

So, I want the plus sign to be saved as a string and displayed on the screen later; so in this case I

String plusSign = "+"; 

but when I show higher on the screen, I get a strange plus sign around which there is a circle. I use a variable in the application I am making, so using android can have something to do with the weird format. Is it like a plus sign that should look like or is there a way to make it look like a regular plus (cross without a circle)?

Let me add a few alternatives that I have tried. The first thing I did was to see if the unicode version of the plus sign would look different, but nothing appeared when I displayed it (the code was \ u002B). I also looked at the ascii version, but was not sure how to convert it to a string.

Here is the code I use to display the onScreen string

  Addition = new Text(PositionX, PositionY, standardFont, "Intergers" + plusSign + "Integers"); mScene.attachChild(Addition); 

I use andEngine, so here is the Text class http://code.google.com/p/andengine/source/browse/src/org/anddev/andengine/entity/text/Text.java

It seems like this is related to Android: http://www.droidforums.net/forum/droid-x-faq/65474-what-those-icons.html

Thus, it seems that if you use a font that does not support a specific character, it by default uses what android has ever used.

+7
source share
3 answers

It seems to me that the font you are using is the most likely culprit. I would double check that the plus symbol does not have a circle in this font. There is another symbol, the symbol "xor" ( "\u2295" ), which is a plus with a circle around it. I can’t think of why the plus symbol will be replaced by this symbol, but you can try to show this character on purpose to see if it looks like what you see in the font used.

+4
source
 String plusSign = "\u002B"; // unicode 
+1
source
 String plusSign = URLEncoder.encode("+", "UTF-8"); 
+1
source

All Articles