#include"script.h" int main() { Str buf( " word1. \nabc ,, word3;" ), word; strI pos = 0; while( getString( 1, buf, pos, word, " ;.,\n" ) ) { // get first word from current position printf( "%s ", word.c_str() ); } // standard output = "word1 abc word3 " printf( "\n" ); pos = 3; while( getString( 2, buf, pos, word, " ;.,\n" ) ) { // get second word from current position printf( "%s ", word.c_str() ); } // standard output = "abc " printf( "\n" ); pos = 11; while( getString( -1, buf, pos, word, " ;.,\n" ) ) { // get first previous word from current position printf( "%s ", word.c_str() ); } // standard output = "abc word1 " printf( "\n" ); pos = 0; getString( 3, buf, pos, word, " ;.,\n" ); // after this word == "word3" printf( "%s\n", word.c_str() ); getString( 4, buf, pos, word, " ;.,\n" ); // after this word is empty; printf( "%s\n", word.c_str() ); }