From: Carlos Ortega Date: 2007-08-06T08:43:07+09:00 Subject: Doubts on char patterns into String.each argument Hello Folks with a question I would like someone can clarify me: When I type the following code: "Substring1 Substring2 Substring3".each( '\s*' ) { | substring | puts "[" + substring +"]" } What I got is: [Substring1 ] [Substring2 ] [Substring3] However when I type: "Substring1 Substring2 Substring3".each( '\s*' ) { | substring | puts "[" + substring +"]" } What I got is: [Substring1 Substring2 Substring3] Why the difference in outputs? I verified in the "Programming Ruby 2nd (Dave Thomas - 2005)" and it says that the ' ' is just one of the White Characters that '\s' may represent ( the other ones are TAB and NEW LINE) Any help would be very appreciated. -- Posted via http://www.ruby-forum.com/.