| 204 | |
| 205 | |
| 206 | cString cString::GetWord(int word_id) const |
| 207 | { |
| 208 | // Find positon of word |
| 209 | int pos = 0; |
| 210 | int cur_word = 0; |
| 211 | while( pos<GetSize() && cur_word<word_id ) { // If this isn't the word |
| 212 | pos += CountWhitespace(pos); // Skip leading whitespace |
| 213 | pos += CountWordsize(pos); // Skip this word |
| 214 | cur_word++; |
| 215 | } |
| 216 | // Return GetWordAt position... (it will skip any leading whitespace) |
| 217 | return GetWordAt(pos); |
| 218 | } |
| 219 | |
| 220 | |
| 221 | cString cString::GetWordAt(int start) const |