mirror of
https://github.com/php/doc-es.git
synced 2026-04-29 10:03:21 +02:00
9f7804a633
* feat(translation): update revision EN * feat(translation): update revision EN
135 lines
3.3 KiB
XML
135 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 27ae0a4a16cdfc868a884c0f0dad7023b5f2709c Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.rtrim" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>rtrim</refname>
|
|
<refpurpose>Elimina los espacios (u otros caracteres) al final de un string</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>rtrim</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>characters</parameter><initializer>" \n\r\t\v\x00"</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Esta función devuelve un string con los espacios (u otros caracteres) eliminados
|
|
al final de <parameter>string</parameter>.
|
|
</simpara>
|
|
<simpara>
|
|
Sin el segundo parámetro,
|
|
<function>rtrim</function> eliminará estos caracteres:
|
|
</simpara>
|
|
&strings.stripped.characters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
El string de entrada.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>characters</parameter></term>
|
|
<listitem>
|
|
&strings.parameter.characters.optional;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
Devuelve el string modificado.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de uso de <function>rtrim</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$text = "\t\tAquí hay algunas palabras :) ... ";
|
|
$binary = "\x09String de ejemplo\x0A";
|
|
$hello = "Hola Mundo";
|
|
var_dump($text, $binary, $hello);
|
|
|
|
print "\n";
|
|
|
|
$trimmed = rtrim($text);
|
|
var_dump($trimmed);
|
|
|
|
$trimmed = rtrim($text, " \t.");
|
|
var_dump($trimmed);
|
|
|
|
$trimmed = rtrim($hello, "Hdlor");
|
|
var_dump($trimmed);
|
|
|
|
// elimina los caracteres de control ASCII al final de $binary
|
|
// (de 0 a 31 inclusive)
|
|
$clean = rtrim($binary, "\x00..\x1F");
|
|
var_dump($clean);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
string(32) " Aquí hay algunas palabras :) ... "
|
|
string(16) " String de ejemplo
|
|
"
|
|
string(10) "Hola Mundo"
|
|
|
|
string(30) " Aquí hay algunas palabras :) ..."
|
|
string(26) " Aquí hay algunas palabras :)"
|
|
string(6) "Hola M"
|
|
string(15) " String de ejemplo"
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>trim</function></member>
|
|
<member><function>ltrim</function></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|