REPT 函數

套用到
SharePoint Server 2019 SharePoint Server 2016 SharePoint Server 2013 SharePoint Server 2013 企業版 SharePoint Foundation 2010 SharePoint Server 2010 Windows SharePoint Services 3.0

依指定的次數重複文字。 使用 REPT 來新增多個文字字串實例。

語法

回覆 (文字number_times)

文字 是你想重複的文字。

Number_times 是正數,表示重複文字的次數。

註解

  • 如果 number_times 為 0 (零),則 REPT 會傳回 "" (空白文字)。
  • 如果 number_times 不是整數,則會取至整數。
  • REPT 函數的結果不得超過 2000 字元,否則 REPT 回傳 #VALUE!。

範例

公式 描述 (結果)
=REPT("*-", 3) 顯示字串三次 (*-*-*-)
=REPT("-",10) 顯示破折號 10 次 (----------)