Skip to content

Instantly share code, notes, and snippets.

@tonyjunkes
Last active August 12, 2020 15:21
Show Gist options
  • Save tonyjunkes/358cc43470d35af35bc1750af1113b45 to your computer and use it in GitHub Desktop.
Save tonyjunkes/358cc43470d35af35bc1750af1113b45 to your computer and use it in GitHub Desktop.
Remove duplicates from an array in CFML using Java
<cfscript>
example = ["a", "b", "c", "a", 1, 2, 1];
HashSet = createObject("java", "java.util.HashSet");
Arrays = createObject("java", "java.util.Arrays");
result = HashSet.init(Arrays.asList(example)).toArray();
writeDump(result);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment