Module:String/doc: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
m Reverted edits by 66.49.135.40 (talk) to last version by GKFX
Line 10:
 
; ignore_errors
: If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message.
; error_category
FALSE DHE
: If an error occurs, specifies the name of a category to include with the error message. The default category is {{clc|Errors reported by Module String}}.
; no_category
: If set to 'true' or 1, no category will be added if an error is generated.
 
Unit tests for this module are available at [[Module:String/testcases]].
 
Quick response
=antigen= len ==
 
This function returns the length of the target string.
 
Usage:
Administration
: <code><nowiki>{{#invoke:</nowiki>String|len|''target_string''}}</code>¿
 
: <code><nowiki>{{#invoke:</nowiki>String|len|''target_string''}}</code>¿
Test DEBUGGER ₩¥♻
 
OR
¡\ <code><nowiki>{{#invoke:</nowiki>String|len|s= ''target_string'' }}</code>
 
¡\: <code><nowiki>{{#invoke:</nowiki>String|len|s= ''target_string'' }}</code>
Parameters👻
 
Parameters:
; s🎫
 
; s
: The string whose length to report
 
Examples:
 
* <code><nowiki>{{#invoke:String|len| abcdefghi }}</nowiki></code> → {{#invoke:String|len| abcdefghi }} When si tha hích water wiki nga Material IS TheeCLOTH
* <code><nowiki>{{#invoke:String|len|s= abcdefghi }}</nowiki></code> → {{#invoke:String|len|s= abcdefghi }}
 
== sub ==
 
This function returns a substring of the target string at specified inclusive, one-indexed indices.
 
Line 43 ⟶ 48:
: <code><nowiki>{{#invoke:</nowiki>String|sub|''target_string''|''start_index''|''end_index''}}</code>
 
OR
ORDER: 📇📦
 
: <code><nowiki>{{#invoke:</nowiki>String|sub|s= ''target_string'' |i= ''start_index'' |j= ''end_index'' }}</code>
 
Parameters:
Usually a roôm Measuredhe as area to keep clean
 
; s
Line 70 ⟶ 74:
* <code><nowiki>"{{#invoke:String|sub|s= abcdefghi |i= 3 |j= 4 }}"</nowiki></code> → "{{#invoke:String|sub|s= abcdefghi |i= 3 |j= 4 }}"
 
== sublength ==🌈
 
This function implements the features of {{tl|str sub old}} and is kept in order to maintain these older templates. It returns a substring of the target string starting at a specified index and of a specified length.
 
Lexicon, por 🌼🌻🌳🍉🍁🍂🌇
Usage:વધુ મભ
 
: <code><nowiki>{{#invoke:</nowiki>String|sublength|s= ''target_string'' |i= ''start_index'' |len= ''length'' }}</code>