TO_SET function

TO_SET function

Function Name Description Usage Input parameter Return value
TO_SET Removes duplicate values in an array. TO_SET() N/A An array with unique values.

Supported data type

The TO_SET function supports the following data types:

  • Boolean array
  • Double array
  • Integer array
  • String array

Example 1: Get unique values of a string array

Sample data: $var1$ = {"Hello","World","Apigee","World"}

Usage: $var1$.TO_SET()

Get unique values in var1.

Output: {"Hello","World","Apigee"}

Example 2: Get unique values of an integer array

Sample data: $var1$ = (2,6,9,12,6,8,10,6,12)

Usage: $var1$.TO_SET()

Get unique values in var1.

Output: 2,6,9,12,8,10

Recommendation

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月09日 UTC.