How to remove duplicate letters from the string without changing case of letters
input "Deleted"
output "Delt"
Discussion posts and replies are publicly visible
A shorter version. I check each character whether it already is part of the substring before it.
a!localVariables( local!text: "Deleted", joinarray( a!foreach( items: enumerate(len(local!text)), expression: if( a!isInText(left(local!text, fv!item), local!text[fv!index]), "", local!text[fv!index] ) ), "" ) )
An alternate solution
a!localVariables( local!word: "DeletEd", local!letters: char(code(local!word)), local!uniq: union(local!letters, local!letters), local!result: a!forEach( local!uniq, wherecontains(1, search(fv!item, local!uniq))[1] ), index( local!uniq, union(local!result, local!result), {} ) )