Last active
August 12, 2020 15:21
-
-
Save tonyjunkes/358cc43470d35af35bc1750af1113b45 to your computer and use it in GitHub Desktop.
Remove duplicates from an array in CFML using Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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