Unique characters: Difference between revisions
no edit summary
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
No edit summary |
||
Line 693:
<pre>156bgstz</pre>
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">window 1, @"Unique characters"
void local fn DoIt
CountedSetRef set = fn CountedSetWithCapacity(0)
CFArrayRef array = @[@"133252abcdeeffd",@"a6789798st",@"yxcdfgxcyz"]
CFStringRef string, chr
long index
CFMutableArrayRef mutArray = fn MutableArrayWithCapacity(0)
for string in array
for index = 0 to len(string) - 1
CountedSetAddObject( set, mid(string,index,1) )
next
next
for chr in set
if ( fn CountedSetCountForObject( set, chr ) == 1 )
MutableArrayAddObject( mutArray, chr )
end if
next
MutableArraySortUsingSelector( mutArray, @"compare:" )
print fn ArrayComponentsJoinedByString( mutArray, @"" )
end fn
fn DoIt
HandleEvents</syntaxhighlight>
{{out}}
<pre>156bgstz</pre>
=={{header|Go}}==
|