Skip to content

Commit

Permalink
Update strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mowangjuanzi committed Jan 12, 2025
1 parent 160259f commit a9eabf7
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 267 deletions.
103 changes: 30 additions & 73 deletions reference/strings/functions/ltrim.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: eabde0419cf90f596f60db00e31fcb6ebe41ac55 Maintainer: daijie Status: ready -->
<!-- EN-Revision: 27ae0a4a16cdfc868a884c0f0dad7023b5f2709c Maintainer: daijie Status: ready -->
<!-- CREDITS: mowangjuanzi -->
<refentry xml:id="function.ltrim" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand All @@ -15,88 +15,47 @@
<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>
<para>
删除字符串开头的空白字符(或其他字符)
</para>
<simpara>
去除字符串开头的空白字符(或其他字符)
</simpara>
<simpara>
不带第二个参数,<function>mb_ltrim</function> 将去除下列字符:
</simpara>
&strings.stripped.characters;
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
输入的字符串。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>characters</parameter></term>
<listitem>
<para>
通过参数 <parameter>characters</parameter>,你也可以指定想要删除的字符,简单地列出你想要删除的所有字符即可。使用<literal>..</literal>,可以指定字符的范围。
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
该函数返回一个删除了 <parameter>string</parameter> 最左边的空白字符的字符串。
如果不使用第二个参数,
<function>ltrim</function> 仅删除以下字符:
<!-- sorted by importance. Printed 3 times: trim, ltrim, rtrim -->
<itemizedlist>
<listitem>
<simpara>
" " (<acronym>ASCII</acronym> <literal>32</literal>
(<literal>0x20</literal>)),普通空白字符。
</simpara>
</listitem>
<listitem>
<simpara>
"\t" (<acronym>ASCII</acronym> <literal>9</literal>
(<literal>0x09</literal>)), 制表符.
</simpara>
</listitem>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<simpara>
"\n" (<acronym>ASCII</acronym> <literal>10</literal>
(<literal>0x0A</literal>)),换行符。
输入字符串。
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>characters</parameter></term>
<listitem>
<simpara>
"\r" (<acronym>ASCII</acronym> <literal>13</literal>
(<literal>0x0D</literal>)),回车符。
</simpara>
&strings.parameter.characters.optional;
</listitem>
<listitem>
<simpara>
"\0" (<acronym>ASCII</acronym> <literal>0</literal>
(<literal>0x00</literal>)), <literal>NUL</literal>空字节符。
</simpara>
</listitem>
<listitem>
<simpara>
"\v" (<acronym>ASCII</acronym> <literal>11</literal>
(<literal>0x0B</literal>)),垂直制表符。
</simpara>
</listitem>
</itemizedlist>
</para>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
该函数返回从 <parameter>string</parameter> 开头去除了空白字符的字符串。
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>ltrim</function>的使用示例</title>
<title><function>ltrim</function> 使用示例</title>
<programlisting role="php">
<![CDATA[
<?php
Expand Down Expand Up @@ -147,12 +106,10 @@ string(15) "Example string

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>trim</function></member>
<member><function>rtrim</function></member>
</simplelist>
</para>
<simplelist>
<member><function>trim</function></member>
<member><function>rtrim</function></member>
</simplelist>
</refsect1>

</refentry>
Expand Down
102 changes: 29 additions & 73 deletions reference/strings/functions/rtrim.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: eabde0419cf90f596f60db00e31fcb6ebe41ac55 Maintainer: daijie Status: ready -->
<!-- EN-Revision: 27ae0a4a16cdfc868a884c0f0dad7023b5f2709c Maintainer: daijie Status: ready -->
<!-- CREDITS: mowangjuanzi -->
<refentry xml:id="function.rtrim" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>rtrim</refname>
<refpurpose>删除字符串末端的空白字符(或者其他字符)</refpurpose>
<refpurpose>去除字符串末尾的空白字符(或者其他字符)</refpurpose>
</refnamediv>

<refsect1 role="description">
Expand All @@ -15,82 +15,40 @@
<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>
<para>
该函数删除 <parameter>string</parameter> 末端的空白字符(或者其他字符)并返回。
</para>
<para>
不使用第二个参数,<function>rtrim</function> 仅删除以下字符:
<!-- sorted by importance. Printed 3 times: trim, ltrim, rtrim -->
<itemizedlist>
<listitem>
<simpara>
" " (<acronym>ASCII</acronym> <literal>32</literal>
(<literal>0x20</literal>)),普通空白符。
</simpara>
</listitem>
<listitem>
<simpara>
"\t" (<acronym>ASCII</acronym> <literal>9</literal>
(<literal>0x09</literal>)),制表符。
</simpara>
</listitem>
<listitem>
<simpara>
"\n" (<acronym>ASCII</acronym> <literal>10</literal>
(<literal>0x0A</literal>)),换行符。
</simpara>
</listitem>
<listitem>
<simpara>
"\r" (<acronym>ASCII</acronym> <literal>13</literal>
(<literal>0x0D</literal>)),回车符。
</simpara>
</listitem>
<simpara>
该函数去除 <parameter>string</parameter> 末尾的空白字符(或者其他字符)并返回。
</simpara>
<simpara>
不使用第二个参数,<function>rtrim</function> 将去除以下字符:
</simpara>
&strings.stripped.characters;
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<simpara>
"\0" (<acronym>ASCII</acronym> <literal>0</literal>
(<literal>0x00</literal>)),<literal>NUL</literal> 空字节符。
输入字符串。
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>characters</parameter></term>
<listitem>
<simpara>
"\v" (<acronym>ASCII</acronym> <literal>11</literal>
(<literal>0x0B</literal>)),垂直制表符。
</simpara>
&strings.parameter.characters.optional;
</listitem>
</itemizedlist>
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
输入字符串。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>characters</parameter></term>
<listitem>
<para>
通过指定 <parameter>characters</parameter>,可以指定想要删除的字符列表。简单地列出你想要删除的全部字符。使用 <literal>..</literal> 格式,可以指定一个范围。
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
返回改变后的字符串。
</para>
</simpara>
</refsect1>

<refsect1 role="examples">
Expand Down Expand Up @@ -146,12 +104,10 @@ string(15) " Example string"

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>trim</function></member>
<member><function>ltrim</function></member>
</simplelist>
</para>
<simplelist>
<member><function>trim</function></member>
<member><function>ltrim</function></member>
</simplelist>
</refsect1>

</refentry>
Expand Down
Loading

0 comments on commit a9eabf7

Please sign in to comment.