docs for testlist/replacestr
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6456 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -237,6 +237,15 @@ docargument [C] [the character to test] [] [0];
|
||||
docargument [N] [type of test to run] [min 0/max 7/default 0] [0];
|
||||
docexample [echo (testchar 1)] [Output: 1 "(because it is a 0-9 digit)"];
|
||||
docremark [See /docs/reference.xml for more information about the usage of this command.];
|
||||
docident [testlist] [Tests a list argument for various things.];
|
||||
docargument [L] [the list to test] [] [0];
|
||||
docargument [N] [the type of test to run] [min 0/max 2/default 0] [0];
|
||||
docremark [See /docs/reference.xml for more information about the usage of this command.];
|
||||
docident [replacestr] [Returns a string, with a portion of it replaced with a new sub-string.];
|
||||
docargument [S] [the original string to modify] [] [0];
|
||||
docargument [T] [the target sub-string to replace] [] [0];
|
||||
docargument [N] [the new sub-string to replace the target] [] [0];
|
||||
docexample [echo (replacestr "Hello cruel world" cruel "")] [Output: Hello world];
|
||||
docsection [General]
|
||||
docident [addserver] [Adds a server to the list of server to query in the server list menu.];
|
||||
docargument [S] [the address of the server (hostname or IP)] [] [0];
|
||||
|
||||
@@ -455,6 +455,7 @@
|
||||
<identifierReference identifier="concatword"/>
|
||||
<identifierReference identifier="strlen"/>
|
||||
<identifierReference identifier="substr"/>
|
||||
<identifierReference identifier="replacestr"/>
|
||||
</references>
|
||||
</command>
|
||||
|
||||
@@ -522,6 +523,8 @@
|
||||
</examples>
|
||||
<references>
|
||||
<identifierReference identifier="strlen"/>
|
||||
<identifierReference identifier="strpos"/>
|
||||
<identifierReference identifier="replacestr"/>
|
||||
</references>
|
||||
</command>
|
||||
|
||||
@@ -1011,7 +1014,56 @@
|
||||
<remark>See the following c++ functions for more information about the usage of this command:</remark>
|
||||
<remark>isalpha(), isalnum(), isdigit(), islower(), isprint(), ispunct(), isupper(), and isspace()</remark>
|
||||
</remarks>
|
||||
<references>
|
||||
<identifierReference identifier="testlist"/>
|
||||
</references>
|
||||
</command>
|
||||
|
||||
<command name="testlist">
|
||||
<description>Tests a list argument for various things.</description>
|
||||
<examples>
|
||||
<example>
|
||||
<code><![CDATA[echo (testlist "1 2.45 8")]]></code>
|
||||
<explanation>Output: 1 // It is a valid list of numbers (supports ints and floats)</explanation>
|
||||
</example>
|
||||
<example>
|
||||
<code><![CDATA[echo (testlist "a B C defg hi jk" 1)]]></code>
|
||||
<explanation>Output: 1 // It is a valid list of alpha-characters a-z or A-Z only</explanation>
|
||||
</example>
|
||||
<example>
|
||||
<code><![CDATA[echo (testlist "a B C defg hi jk" 2)]]></code>
|
||||
<explanation>Output: 1 // It is a valid list of alpha-characters a-z or A-Z or whitespace only</explanation>
|
||||
</example>
|
||||
</examples>
|
||||
<arguments>
|
||||
<argument token="L" description="the list to test"/>
|
||||
<argument token="N" description="type of test to run" valueNotes="min 0/max 2/default 0"/>
|
||||
</arguments>
|
||||
<references>
|
||||
<identifierReference identifier="testchar"/>
|
||||
</references>
|
||||
</command>
|
||||
|
||||
<command name="replacestr">
|
||||
<description>Returns a string, with a portion of it replaced with a new sub-string.</description>
|
||||
<examples>
|
||||
<example>
|
||||
<code><![CDATA[echo (replacestr "Hello cruel world" cruel "")]]></code>
|
||||
<explanation>Output: Hello world</explanation>
|
||||
</example>
|
||||
</examples>
|
||||
<arguments>
|
||||
<argument token="S" description="the original string to modify"/>
|
||||
<argument token="T" description="the target sub-string to replace"/>
|
||||
<argument token="N" description="the new sub-string to replace the target"/>
|
||||
</arguments>
|
||||
<references>
|
||||
<identifierReference identifier="strins"/>
|
||||
<identifierReference identifier="strpos"/>
|
||||
<identifierReference identifier="substr"/>
|
||||
</references>
|
||||
</command>
|
||||
|
||||
|
||||
</identifiers>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user