function n = s_digits_count ( s )

%*****************************************************************************80
%
%% s_digits_count() counts the digits in a string.
%
%  Discussion:
%
%    The string may include spaces, letters, and dashes, but only the
%    digits 0 through 9 will be counted.
%
%  Example:
%
%    S  => 34E94-70.6
%    N <=  7
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    09 September 2015
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    string S, the string.
%
%  Output:
%
%    integer N, the number of digits.
%
  s_len = length ( s );

  s_pos = 0;
  n = 0;

  while ( s_pos < s_len )

    s_pos = s_pos + 1;

    c = s(s_pos);

    if ( ch_is_digit ( c ) )
      n = n + 1;
    end

  end

  return
end
