Here's the algorithm in a C-like pseudocode...
set global vowels = 'aeiou'
set global another = empty string
for i = 1 to length(input_string) by 1
set local variable L = letter at input_string position i
if AND(not(contains(vowels,L)),not(contains(another,L)) // not a vowel or already in another
then set another = JOIN(another,L)
end for i
// another contains all consonants of input_string
ABG
P.S. This can be made even shorter using DeMorgan's Law and a JOIN.