Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whitespace

 
Yuan Du
Ranch Hand
Posts: 34
  • 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
  • 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: 21510
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Thank you , i got it.

Yuan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic