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

Lines changed: 5 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy