#include"script.h" int main() { Str buf( "abc#578fv, 533wd32;" ), nr; strI pos = 0; while( getDigits( 1, buf, pos, nr ) ) { // get first number from current position printf( "%s ", nr.c_str() ); } // standard output = "578 533 32 " printf( "\n" ); pos = 3; while( getDigits( 2, buf, pos, nr ) ) { // get second number from current position printf( "%s ", nr.c_str() ); } // standard output = "533 " printf( "\n" ); pos = 12; while( getDigits( -1, buf, pos, nr ) ) { // get first previous number from current position printf( "%s ", nr.c_str() ); } // standard output = "533 578 " pos = 0; printf( "\n" ); getDigits( 3, buf, pos, nr ); // after this nr == "32" printf( "%s\n", nr.c_str() ); getDigits( 4, buf, pos, nr ); // after this nr is empty; printf( "%s\n", nr.c_str() ); }