File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whitespace

 
Yuan Du
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

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

Thank you!

Yuan
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes " " is a space while "\\s" is an \s

are you talking about java ??
 
Henry Wong
author
Marshal
Pie
Posts: 20823
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Yuan Du
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Thank you , i got it.

Yuan
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic