Template:Str crop
Template page
More actions
Revision as of 06:17, 20 February 2025 by Prd (talk | contribs) (Created page with "<includeonly>{{safesubst:#invoke:String | sub | s={{{1|}}} | 1 | {{safesubst:#expr: -{{{2|1}}} - 1}} | ignore_errors=true }}</includeonly><noinclude> {{documentation}}</noinclude>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Usage
Use to remove the right-most {{{2}}} characters of a string {{{1}}}.
Example
| Code | Result |
|---|---|
{{str crop |Example |3}}
|
Exam |
{{str crop |123.456|3}}
|
123. |
{{str crop |123.456|-3}}
|
12 |
{{str crop |123.456|4}}
|
123 |
{{str crop |123.456|-4}}
|
123 |
{{str crop |123.456|0}}
|
123.456 |
{{str crop |123.456|7}}
|
See also
String-handling templates (help page) | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
The above documentation is transcluded from Template:Str crop/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://kenshi.wiki/index.php?title=Template:Str_crop&oldid=7418"