ထာမ်ပလိက်:Str index
This template is used on approximately ၁၁၀၀၀ pages, so changes to it will be widely noticed. Please test any changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Please consider discussing changes on the talk page before implementing them. |
Uses Lua: |
Usage[ပလေဝ်ဒါန် တမ်ကၞက်]
{{str index|text|number}} = Returns the number-th character of text.
Base 1: the first character is numbered 1, and so on. Any leading or trailing whitespace is removed from the string before searching.
If the requested position is negative, this function will search the string counting from the last character. In other words, number = -1 is the same as asking for the last character of the string.
A requested position equal to zero or with a value longer than the string will generate an error.
This function will properly return a space character (' ') if the selected position contains a space.
Examples[ပလေဝ်ဒါန် တမ်ကၞက်]
ထာမ်ပလိက်:Tlp
→ String Module Error: String index out of rangeထာမ်ပလိက်:Tlp
→ 0ထာမ်ပလိက်:Tlp
→ Eထာမ်ပလိက်:Tlp
→ String Module Error: String index out of range
See also[ပလေဝ်ဒါန် တမ်ကၞက်]
ထာမ်ပလိက်:String-handling templates
The above documentation is transcluded from ထာမ်ပလိက်:Str index/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |