In Java, should I escape a single quotation mark (') in String (double quoted)? -


in java, \' denotes single quotation mark (single quote) character, , \" denotes double quotation mark (double quote) character.

so, string s = "i\'m human."; works well.

however, string s = "i'm human." not make compile errors, either.

likewise, char c = '\"'; works, char c = '"'; works.

in java, better use? in html or css, things style="font-family:'arial unicode ms';" more (and such tags, think it's way use quotation marks), in java, saw people use escape characters "i\'m human."

you don't need escape ' character in string (wrapped in "), , don't have escape " character in char (wrapped in ').


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -