Repeat ( myText ; Number )
Repeat text a specified number of times
Average rating: 4.2 (42 votes) Log in to vote
Rob Poelking - Show more from this author
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Repeats a character or text string the number of times specified. Useful in padding text.
|Heather McCue, Dallas
Apr 29, 2009
|Note that this CF cannot be defined in FileMaker 10 as shown here in due to the introduction of a 'char' function. Modify the parameter name and it works great.
Just what I needed. Quick & Simple!
|aaron, san diego, ca
Jun 18, 2009
|a shorter version
Case ( repeatCount > 0 ; text & Repeat ( text ; repeatCount - 1 ) )
|Ibrahim Bittar, Leon, Mexico
Oct 13, 2011
|Thank you so much, it works like a charm, however, I had to change the parameter "char" by "text", given that char is a reserved word.|
|Rob Poelking, Excelisys, Inc.
Oct 13, 2011
|Yes, I wrote the function before FM introduced the Char function. Glad you can use it, I appreciate the feedback.|
Feb 13, 2017
|A simpler approach for less than 404 repetitions:
Substitute ( 10 ^ Number - 1 ; 9 ; Text )
|Walter Whitman Moore, Beverly Hills
Sep 21, 2017
|You are a genius! I love this! I didn't even know one could create custom functions! THANK YOU BRIAN DUNNING!|
Dec 23, 2017
|Guys, you make my day...
It's a real pleasure to read such beautiful code, and I can't decide wich one is the most smart beetween Miguel and Aaron... Congratulation to all...
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.