Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 33ae03f

Browse files
committed
Document that translate() removes characters in "from" that don't have
a corresponding "to" character. Author: Josh Kupershmidt
1 parent 07f1264 commit 33ae03f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/src/sgml/func.sgml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1866,10 +1866,12 @@
18661866
Any character in <parameter>string</parameter> that matches a
18671867
character in the <parameter>from</parameter> set is replaced by
18681868
the corresponding character in the <parameter>to</parameter>
1869-
set
1869+
set. If <parameter>from</parameter> is longer than
1870+
<parameter>to</parameter>, occurrences of the extra characters in
1871+
<parameter>from</parameter> are removed.
18701872
</entry>
1871-
<entry><literal>translate('12345', '14', 'ax')</literal></entry>
1872-
<entry><literal>a23x5</literal></entry>
1873+
<entry><literal>translate('12345', '143', 'ax')</literal></entry>
1874+
<entry><literal>a2x5</literal></entry>
18731875
</row>
18741876

18751877
</tbody>

0 commit comments

Comments
 (0)