It's not a secret anymore!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes whitespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "whitespace" Watch "whitespace" New topic
Author

whitespace

Yuan Du
Ranch Hand

Joined: Nov 20, 2008
Posts: 34
Hi everyone,

is there any difference between " " and "\\s"?

Thank you!

Yuan
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
yes " " is a space while "\\s" is an \s

are you talking about java ??


Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19073
    
  40

I am going to make an assumption that this question is related to the regex engine...

In regex, a " " will match a single space. And a "\\s" will match a single whitespace. A whitespace is either a space, a tab, a vertical tab, a form feed, a carriage return, or a line feed.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Yuan Du
Ranch Hand

Joined: Nov 20, 2008
Posts: 34
Ok Thank you , i got it.

Yuan
 
 
subject: whitespace