BigQuery
String48 fungsi

Fungsi String BigQuery

Fungsi untuk manipulasi teks dan karakter. Temukan semua 48 fungsi string di BigQuery lengkap dengan syntax, contoh, dan penjelasan bahasa Indonesia.

48 fungsi string di BigQuery

← Semua fungsi BigQuery

ASCII

String

Returns the ASCII value (code point) of the first character in the string.

Tipe hasil: INT64

BYTE_LENGTH

String

Mengembalikan jumlah bytes dari STRING atau BYTES value.

Tipe hasil: INT64

CHAR_LENGTH

String

Returns the number of characters in a string. An alias for LENGTH, available for standard SQL compatibility.

Tipe hasil: INT64

CHR

String

Converts a Unicode code point value into a string character. The inverse of the ASCII function.

Tipe hasil: STRING

CODE_POINTS_TO_BYTES

String

Converts an array of code points (extended ASCII 0–255) into BYTES.

Tipe hasil: BYTES

CODE_POINTS_TO_STRING

String

Converts an array of Unicode code points into a STRING.

Tipe hasil: STRING

CONCAT

String

Concatenates two or more strings into one. A foundational string concatenation function in BigQuery that supports multiple data types.

Tipe hasil: STRING

CONTAINS_SUBSTR

String

Checks whether a string contains a specified substring. Case-insensitive and supports JSON structures.

Tipe hasil: BOOL

ENDS_WITH

String

Checks whether a string ends with a specified suffix. Returns a boolean.

Tipe hasil: BOOL

FARM_FINGERPRINT

String

Menghitung fingerprint menggunakan algoritma FarmHash. Sangat cepat dan cocok untuk BigQuery.

Tipe hasil: INT64

FORMAT

String

Formats values into a string based on a format string (similar to printf). Supports a wide range of format specifiers.

Tipe hasil: STRING

GENERATE_UUID

String

Menghasilkan UUID (Universally Unique Identifier) versi 4 secara random.

Tipe hasil: STRING

INITCAP

String

Capitalizes the first letter of each word and lowercases the rest. Title case transformation.

Tipe hasil: STRING

INSTR

String

Finds the position of a substring within a string. Supports searching from a specific position and locating the nth occurrence.

Tipe hasil: INT64

LEFT

String

Extracts a specified number of characters from the left (beginning) of a string. A more readable shorthand than SUBSTR for extracting leading characters.

Tipe hasil: STRING

LENGTH

String

Returns the number of characters in a string. For BYTES, returns the number of bytes.

Tipe hasil: INT64

LOWER

String

Converts all characters in a string to lowercase. Supports Unicode characters.

Tipe hasil: STRING

LPAD

String

Pads the left side of a string with characters until it reaches a specified length. Left padding.

Tipe hasil: STRING

LTRIM

String

Removes characters from the left side (beginning) of a string. Left trim for leading characters.

Tipe hasil: STRING

MD5

String

Menghitung MD5 hash dari input. Return BYTES.

Tipe hasil: BYTES

NORMALIZE

String

Normalizes a Unicode string to a canonical form. Useful for consistent string comparisons across different Unicode representations.

Tipe hasil: STRING

NORMALIZE_AND_CASEFOLD

String

Normalizes a Unicode string and applies case-folding for correct Unicode-aware case-insensitive comparisons.

Tipe hasil: STRING

REGEXP_CONTAINS

String

Returns TRUE if the value matches the regular expression. Useful for pattern matching and format validation.

Tipe hasil: BOOL

REGEXP_EXTRACT

String

Extracts the first substring that matches the regular expression. If the pattern has a capturing group, returns that group instead.

Tipe hasil: STRING

REGEXP_EXTRACT_ALL

String

Extracts all substrings that match the regular expression and returns them as an array.

Tipe hasil: ARRAY<STRING>

REGEXP_INSTR

String

Returns the position (1-based) of the substring that matches the regular expression. Returns 0 if there is no match.

Tipe hasil: INT64

REGEXP_REPLACE

String

Replaces all substrings that match the regular expression with a replacement string. Supports backreferences.

Tipe hasil: STRING

REGEXP_SUBSTR

String

Alias for REGEXP_EXTRACT. Extracts the substring that matches the regular expression.

Tipe hasil: STRING

REPEAT

String

Repeats a string n times. Useful for generating patterns.

Tipe hasil: STRING

REPLACE

String

Replaces all occurrences of a substring with a new string. Replacement is case-sensitive.

Tipe hasil: STRING

REVERSE

String

Reverses the order of characters in a string. The first character becomes the last and vice versa.

Tipe hasil: STRING

RIGHT

String

Extracts a specified number of characters from the right (end) of a string. A more readable shorthand for extracting trailing characters.

Tipe hasil: STRING

RPAD

String

Pads the right side of a string with characters until it reaches a specified length. Right padding.

Tipe hasil: STRING

RTRIM

String

Removes characters from the right side (end) of a string. Right trim for trailing characters.

Tipe hasil: STRING

SAFE_CONVERT_BYTES_TO_STRING

String

Safely converts a BYTES value to a STRING, replacing any invalid UTF-8 characters with the Unicode replacement character instead of raising an error.

Tipe hasil: STRING

SESSION_USER

String

Mengembalikan email address dari user yang menjalankan query.

Tipe hasil: STRING

SHA1

String

Menghitung SHA-1 hash dari input. Return BYTES.

Tipe hasil: BYTES

SHA256

String

Menghitung SHA-256 hash dari input. Aman untuk kriptografi.

Tipe hasil: BYTES

SHA512

String

Menghitung SHA-512 hash dari input. Hash paling kuat di keluarga SHA-2.

Tipe hasil: BYTES

SPLIT

String

Splits a string into an array based on a delimiter. Very useful for parsing CSV-style data.

Tipe hasil: ARRAY<STRING>

STARTS_WITH

String

Checks whether a string begins with a specified prefix. Returns a boolean.

Tipe hasil: BOOL

STRPOS

String

Finds the first position of a substring within a string. A simplified version of INSTR.

Tipe hasil: INT64

SUBSTR

String

Extracts a portion of characters from a string starting at a specified position. An alias for SUBSTRING, highly useful for data extraction and parsing.

Tipe hasil: STRING

SUBSTRING

String

Extracts a portion of characters from a string. Identical to SUBSTR, available for standard SQL compatibility.

Tipe hasil: STRING

TO_CODE_POINTS

String

Converts a STRING or BYTES value into an array of code points (Unicode code points for STRING, values 0-255 for BYTES).

Tipe hasil: ARRAY<INT64>

TRANSLATE

String

Replaces each character from the source character set with the corresponding character in the target character set. Character-level translation.

Tipe hasil: STRING

TRIM

String

Removes characters from the beginning and end of a string. By default, removes whitespace.

Tipe hasil: STRING

UPPER

String

Converts all characters in a string to uppercase. Supports Unicode characters.

Tipe hasil: STRING