Difference between revisions of "Documentation/How Tos/Calc: REPT function"
From Apache OpenOffice Wiki
< Documentation | How Tos
Javier Lopez (Talk | contribs) |
(→REPT: the whole "comprises" the parts and the parts "compose" the whole; the idiom "compose of" is controversial and ambiguous. "include" is uncontroversial, and plain & simple, like the truth - end of editorial) |
||
Line 36: | Line 36: | ||
== REPT == | == REPT == | ||
− | returns a text string | + | returns a text string which includes repetitions of another text string. |
=== Syntax: === | === Syntax: === | ||
Line 43: | Line 43: | ||
=== Example: === | === Example: === | ||
− | * <tt>'''REPT("ha"; | + | * <tt>'''REPT("ha"; 7)'''</tt> |
− | :: returns <tt>''' | + | :: returns <tt>'''hahahahahahaha'''</tt>! |
* <tt>'''REPT(ROUND(RAND()*10); 3)'''</tt> | * <tt>'''REPT(ROUND(RAND()*10); 3)'''</tt> | ||
:: returns <tt>'''nnn'''</tt> where <tt>'''n'''</tt> is a random digit repeated three times, while: | :: returns <tt>'''nnn'''</tt> where <tt>'''n'''</tt> is a random digit repeated three times, while: |
Revision as of 22:05, 1 December 2015
CALC FUNCTIONS
- Text Functions
- BaseCharCleanCodeConcatenateDollarExactFindFixedLeftLenLowerMidProperReplaceReptRightSearchSubstituteTText
Contents
REPT
returns a text string which includes repetitions of another text string.
Syntax:
REPT(text; number)
- returns number copies of text, joined together.
Example:
- REPT("ha"; 7)
- returns hahahahahahaha!
- REPT(ROUND(RAND()*10); 3)
- returns nnn where n is a random digit repeated three times, while:
- CONCATENATE(ROUND(RAND()*10); ROUND(RAND()*10); ROUND(RAND()*10))
- returns xyz where x, y, z are three randomly independent digits.
- returns nnn where n is a random digit repeated three times, while:
-