 <p>The <a href="http://www.adaic.org/resources/add_content/standards/05rm/html/RM-A-4-2.html" rel="nofollow">Ada.Strings.Maps</a> packages would likely be very helpful here, particularly the "To_Set" (define the characters you want to strip out in a Character_Sequence) and "Is_In" functions.</p> <p>Since you're deleting, rather than replacing, characters, you'll have to iterate through the string, checking to see whether each one "is in" the set of those to be deleted. If so, don't append it to the output string buffer.</p>