|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, February 06, 2013 11:51 PM
Points: 1,263,
Visits: 1,079
|
|
Hugo Kornelis (7/13/2010)
Both the text before the first delimiter and the text after the last delimiter will be a row, as each bit of text between two delimiters. That results in #rows = #delimiters + 1.
You can see this in the WHERE clause: WHERE (...) = @StringDelimiter -- Twelve rows, for the twelve delimiters. OR Number - 1 = LEN(@Text) -- One row, for the end of the text.
If the last character is a delimiter (that is, if the text had ended in a dot instead of a question mark), the number of rows would be equal to the number of delimiters, with the "last" row matching both of the OR'ed conditions.
Hugo,
thank you very much for your detailed explanation. In my mind, a sentence always ends with a dot; hence I was only looking at the left side of the delimiter. Just realized after my initial post that the last piece of text ended with a question mark; so the right hand side needs to be considered as well.
Thanks again, Michael
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Wednesday, July 25, 2012 9:04 PM
Points: 542,
Visits: 187
|
|
| I selected None as i got lost in the logic. also i thought 0 & none would be same isn't it?
|
|
|
|