Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure Reverse_Words(Text : in out String) is
- Current : Positive;
- End_Of_Word : Positive := 1;
- Start_Of_Word : Positive := 1;
- begin
- Current := Text'First;
- while Current <= Text'Last loop
- if not Is_Alphanumeric(Text(Current)) then
- Current := Current + 1;
- else
- Start_Of_Word := Current;
- while Is_Alphanumeric(Text(Current)) loop
- Current := Current + 1;
- end loop;
- End_Of_Word := Current;
- end if;
- end loop;
- Reverse_String(Text(Start_Of_Word .. End_Of_Word));
- end Reverse_Words;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement