MCPcopy Create free account
hub / github.com/devosoft/avida / GetWord

Method GetWord

avida-core/source/tools/cString.cc:206–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205
206cString 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
221cString cString::GetWordAt(int start) const

Callers 1

FindMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected