跳至內容

模板:Str rightc/doc

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書

用法

[編輯]
{{str rightc|<字符串>|<长度>}}
{{str rightc|<字符串>|<长度>|<空字符串结果>}}

返回字符串右側指定長度的字符子串。如果提供了<空字符串結果>參數,則當字符串為空時返回該值。

示例

[編輯]
  • {{str rightc |Lorem ipsum dolor sit amet |10}} → r sit amet
  • {{str rightc |Lorem ipsum dolor sit amet |1}} → t
  • {{str rightc |Lorem ipsum dolor sit amet |0}}
  • {{str rightc | |1 |string is empty}} → string is empty
  • {{str rightc |123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-1 |99}} → 3456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-1

模板數據

[編輯]
以下是該模板的模板資料,適用於視覺化編輯器等工具。

Str rightc模板資料

返回字符串最右側指定數量的字符。

模板參數

參數描述類型狀態
字符串1

待處理的字符串

字串必填
數量2

從右側返回的字符數量

數值必填
空字符串結果3

當字符串為空時返回的結果

字串非必填

參見

[編輯]