RosettaCodeData/Task/Reverse-words-in-a-string/Ada/reverse-words-in-a-string-1.ada
2015-02-20 09:02:09 -05:00

11 lines
422 B
Ada

package Simple_Parse is
-- a very simplistic parser, useful to split a string into words
function Next_Word(S: String; Point: in out Positive)
return String;
-- a "word" is a sequence of non-space characters
-- if S(Point .. S'Last) holds at least one word W
-- then Next_Word increments Point by len(W) and returns W.
-- else Next_Word sets Point to S'Last+1 and returns ""
end Simple_Parse;