views:

161

answers:

4

what is difference of below operators for spaces?

\t, \n, \x0B, \f and \r.

+5  A: 

Looks like you left out the operators, but I'm interpreting you to want to know how various Java APIs handle those characters.

The Java handling of these characters is determined by their Unicode character properties. See the Unicode spec to see what properties they have, and thus what the different functions in Character return for them.

www.unicode.org will tell you all you ever wanted to know about Unicode properties.

bmargulies
where i have to refer those stuff?
Praveen Chandrasekaran
http://java.sun.com/docs/books/tutorial/java/data/characters.html
tim_yates
Since when is a tab, line feed, vertical tab, and carriage return a space?
Steve Kuo
@Steve Kuo, in the terminology of the questions, they were more spaces than operators. Point taken.
bmargulies
+7  A: 

\t The tab character ('\u0009')

\n The newline (line feed) character ('\u000A')

\r The carriage-return character ('\u000D')

\f The form-feed character ('\u000C')

\x0B The vertical tabulation (VT) character

Bruno Rothgiesser
\x0B is not space \x20 is the space.
codaddict
@codaddict - you're right. It's the vertical tabulation character. Just edited it. Thanks
Bruno Rothgiesser
+3  A: 
\t - Horizontal tab
\n - New line
\x0B - Vertical tab
\f - form feed
\r - carriage return
codaddict
+4  A: 

They are not operators, they are string/char literals for different characters: http://www.janeg.ca/scjp/lang/charLiteral.html

Andrey