跳至內容

模板: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

當字串為空時返回的結果

字串非必填

參見

[編輯]