Here is an example where there are new lines and have to validate if the exact text is displayed in the correct order using xpath.
User-agent: *
Disallow: /clickthrough.html
Disallow: /details.html
Disallow: /post-sendtofriend.html
Use normalize-space(), which will throw away the leading and trailing whitespace characters (and condense repeating spaces in the middle of the text into a single space), so that you can compare the normalized text() and use to filter in a predicate.
Here is the xpath code to validate the above text
try
{
selenium.getText("//test[normalize-space()]").Equals("pass the string here");
}
catch(Exception)
{
}
