You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/preview/sql/functions/text.md
+20-18Lines changed: 20 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,11 +59,11 @@ This section describes functions and operators for examining and manipulating [`
59
59
|[`like_escape(string, like_specifier, escape_character)`](#like_escapestring-like_specifier-escape_character)| Returns `true` if the `string` matches the `like_specifier` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})) using case-sensitive matching. `escape_character` is used to search for wildcard characters in the `string`. |
60
60
|[`lower(string)`](#lowerstring)| Converts `string` to lower case. |
61
61
|[`lpad(string, count, character)`](#lpadstring-count-character)| Pads the `string` with the `character` on the left until it has `count` characters. Truncates the `string` on the right if it has more than `count` characters. |
62
-
|[`ltrim(string[, characters])`](#ltrimstring-characters)| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
62
+
|[`ltrim(string[, characters])`](#ltrimstring-characters)| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. |
63
63
|[`md5(string)`](#md5string)| Returns the MD5 hash of the `string` as a `VARCHAR`. |
64
64
|[`md5_number(string)`](#md5_numberstring)| Returns the MD5 hash of the `string` as a `HUGEINT`. |
65
-
|[`md5_number_lower(string)`](#md5_number_lowerstring)| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
66
-
|[`md5_number_upper(string)`](#md5_number_upperstring)| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
65
+
|[`md5_number_lower(string)`](#md5_number_lowerstring)| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
66
+
|[`md5_number_upper(string)`](#md5_number_upperstring)| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
67
67
|[`nfc_normalize(string)`](#nfc_normalizestring)| Converts `string` to Unicode NFC normalized string. Useful for comparisons and ordering if text data is mixed between NFC normalized and not. |
68
68
|[`not_ilike_escape(string, like_specifier, escape_character)`](#not_ilike_escapestring-like_specifier-escape_character)| Returns `false` if the `string` matches the `like_specifier` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})) using case-insensitive matching. `escape_character` is used to search for wildcard characters in the `string`. |
69
69
|[`not_like_escape(string, like_specifier, escape_character)`](#not_like_escapestring-like_specifier-escape_character)| Returns `false` if the `string` matches the `like_specifier` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})) using case-sensitive matching. `escape_character` is used to search for wildcard characters in the `string`. |
@@ -91,7 +91,7 @@ This section describes functions and operators for examining and manipulating [`
91
91
|[`right(string, count)`](#rightstring-count)| Extract the right-most `count` characters. |
92
92
|[`right_grapheme(string, count)`](#right_graphemestring-count)| Extracts the right-most `count` grapheme clusters. |
93
93
|[`rpad(string, count, character)`](#rpadstring-count-character)| Pads the `string` with the `character` on the right until it has `count` characters. Truncates the `string` on the right if it has more than `count` characters. |
94
-
|[`rtrim(string[, characters])`](#rtrimstring-characters)| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
94
+
|[`rtrim(string[, characters])`](#rtrimstring-characters)| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. |
95
95
|[`sha1(value)`](#sha1value)| Returns a `VARCHAR` with the SHA-1 hash of the `value`. |
96
96
|[`sha256(value)`](#sha256value)| Returns a `VARCHAR` with the SHA-256 hash of the `value`|
97
97
|[`split(string, separator)`](#splitstring-separator)| Splits the `string` along the `separator`. |
@@ -109,12 +109,12 @@ This section describes functions and operators for examining and manipulating [`
109
109
|[`substring(string, start[, length])`](#substringstring-start-length)| Extracts substring starting from character `start` up to the end of the string. If optional argument `length` is set, extracts a substring of `length` characters instead. Note that a `start` value of `1` refers to the first character of the `string`. |
110
110
|[`substring_grapheme(string, start[, length])`](#substring_graphemestring-start-length)| Extracts substring starting from grapheme clusters `start` up to the end of the string. If optional argument `length` is set, extracts a substring of `length` grapheme clusters instead. Note that a `start` value of `1` refers to the `first` character of the `string`. |
111
111
|[`suffix(string, search_string)`](#suffixstring-search_string)| Returns `true` if `string` ends with `search_string`. |
112
-
|[`to_base(number, raxid[, min_length])`](#to_basenumber-raxid-min_length)| Converts `number` to a string in the given base `radix`, optionally padding with leading zeros to `min_length`. |
112
+
|[`to_base(number, radix[, min_length])`](#to_basenumber-radix-min_length)| Converts `number` to a string in the given base `radix`, optionally padding with leading zeros to `min_length`. |
113
113
|[`to_base64(blob)`](#to_base64blob)| Converts a `blob` to a base64 encoded string. |
114
114
|[`to_binary(string)`](#to_binarystring)| Converts the `string` to binary representation. |
115
115
|[`to_hex(string)`](#to_hexstring)| Converts the `string` to hexadecimal representation. |
116
116
|[`translate(string, from, to)`](#translatestring-from-to)| Replaces each character in `string` that matches a character in the `from` set with the corresponding character in the `to` set. If `from` is longer than `to`, occurrences of the extra characters in `from` are deleted. |
117
-
|[`trim(string[, characters])`](#trimstring-characters)| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
117
+
|[`trim(string[, characters])`](#trimstring-characters)| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. |
118
118
|[`ucase(string)`](#ucasestring)| Converts `string` to upper case. |
119
119
|[`unbin(value)`](#unbinvalue)| Converts a `value` from binary representation to a blob. |
120
120
|[`unhex(value)`](#unhexvalue)| Converts a `value` from hexadecimal representation to a blob. |
@@ -216,7 +216,7 @@ This section describes functions and operators for examining and manipulating [`
216
216
217
217
|**Description**| Draws a band whose width is proportional to (`x - min`) and equal to `width` characters when `x` = `max`. `width` defaults to 80. |
218
218
|**Example**|`bar(5, 0, 20, 10)`|
219
-
|**Result**|`██▌␣␣␣␣␣␣␣`|
219
+
|**Result**|`██▌`|
220
220
221
221
#### `base64(blob)`
222
222
@@ -497,9 +497,9 @@ This section describes functions and operators for examining and manipulating [`
497
497
498
498
<divclass="nostroke_table"></div>
499
499
500
-
|**Description**| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
501
-
|**Example 1**|`ltrim('␣␣␣␣test␣␣')`|
502
-
|**Result**|`test␣␣`|
500
+
|**Description**| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. |
501
+
|**Example 1**|`ltrim('test')`|
502
+
|**Result**|`test`|
503
503
|**Example 2**|`ltrim('>>>>test<<', '><')`|
504
504
|**Result**|`test<<`|
505
505
@@ -523,15 +523,15 @@ This section describes functions and operators for examining and manipulating [`
523
523
524
524
<divclass="nostroke_table"></div>
525
525
526
-
|**Description**| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
526
+
|**Description**| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
527
527
|**Example**|`md5_number_lower('abc')`|
528
528
|**Result**|`8250560606382298838`|
529
529
530
530
#### `md5_number_upper(string)`
531
531
532
532
<divclass="nostroke_table"></div>
533
533
534
-
|**Description**| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
534
+
|**Description**| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
535
535
|**Example**|`md5_number_upper('abc')`|
536
536
|**Result**|`12704604231530709392`|
537
537
@@ -758,9 +758,9 @@ This section describes functions and operators for examining and manipulating [`
758
758
759
759
<divclass="nostroke_table"></div>
760
760
761
-
|**Description**| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
762
-
|**Example 1**|`rtrim('␣␣␣␣test␣␣')`|
763
-
|**Result**|`␣␣␣␣test`|
761
+
|**Description**| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. |
762
+
|**Example 1**|`rtrim('test')`|
763
+
|**Result**|`test`|
764
764
|**Example 2**|`rtrim('>>>>test<<', '><')`|
765
765
|**Result**|`>>>>test`|
766
766
@@ -917,7 +917,9 @@ This section describes functions and operators for examining and manipulating [`
917
917
|**Result**|`true`|
918
918
|**Alias**|`ends_with`|
919
919
920
-
#### `to_base(number, raxid[, min_length])`
920
+
#### `to_base(number, radix[, min_length])`
921
+
922
+
<divclass="nostroke_table"></div>
921
923
922
924
|**Description**| Converts `number` to a string in the given base `radix`, optionally padding with leading zeros to `min_length`. |
923
925
|**Example**|`to_base(42, 16, 5)`|
@@ -962,8 +964,8 @@ This section describes functions and operators for examining and manipulating [`
962
964
963
965
<divclass="nostroke_table"></div>
964
966
965
-
|**Description**| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
966
-
|**Example 1**|`trim('␣␣␣␣test␣␣')`|
967
+
|**Description**| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. |
0 commit comments