This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 20043
    
  44

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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: whitespace
 
It's not a secret anymore!