Converts a STRING or BYTES value into an array of code points (Unicode code points for STRING, values 0-255 for BYTES).
ARRAY<INT64>Diperbarui: 13 Jun 2026TO_CODE_POINTS(value)The string or bytes value to convert.
1 SELECT 2 text, 3 TO_CODE_POINTS(text) as code_points 4 FROM UNNEST(['Hello', '你好']) as text;
Convert strings to arrays of code points.
| text | code_points |
|---|---|
| Hello | [72, 101, 108, 108, 111] |
| 你好 | [20320, 22909] |
1 SELECT 2 code, 3 CHR(code) as char, 4 CASE 5 WHEN code BETWEEN 65 AND 90 THEN 'upper' 6 WHEN code BETWEEN 97 AND 122 THEN 'lower' 7 ELSE 'other' 8 END as type 9 FROM UNNEST(TO_CODE_POINTS('Hello123')) as code;
Analyze each character individually.
Sudah paham TO_CODE_POINTS? Latih langsung di browser
Latihan interaktif, langsung di browser.