function s_word_extract_first_test ( )

%*****************************************************************************80
%
%% s_word_extract_first_test() tests s_word_extract_first().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 January 2006
%
%  Author:
%
%    John Burkardt
%
  s = 'Just an incontrovertible sample of text!';

  fprintf ( 1, '\n' );
  fprintf ( 1, 's_word_extract_first_test():\n' );
  fprintf ( 1, '  s_word_extract_first() extracts the first word from a string.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Our input string is:\n' );
  fprintf ( 1, '  "%s"\n', s );
  fprintf ( 1, '\n' );

  while ( true )

    [ word, s ] = s_word_extract_first ( s );

    if ( s_len_trim ( word ) <= 0 )
      fprintf ( 1, '\n' );
      fprintf ( 1, '  Reached the last word.\n' );
      break
    end

    fprintf ( 1, '  "%s"\n', word );

  end

  return
end



