傳回將指定文字重複多次的結果。
使用範本
REPT("ha",4)
REPT(A2,3)
語法
REPT(text_to_repeat, number_of_repetitions)
重複文字要重複的字元或字串。重複次數- The number of times重複文字should appear in the value returned.- The maximum number of repetitions is 100. IF
重複次數is greater than 100,REPTwill only repeat the text 100 times.
- The maximum number of repetitions is 100. IF
附註
REPTdoes not insert spaces between repetitions of重複文字. IFspaces are desired, a space must be appended to the end of the value of重複文字. The resulting return value fromREPTwill have at least one trailing space, which may be removed withTRIM.
另請參閱
TRIM: 移除文字開頭、結尾和重複的空格。
SUBSTITUTE: 以新文字取代字串中的現有文字。
SPLIT: 以指定字元或字串分隔文字,並將分隔後的區段放入同一列的不同儲存格。