Re: Create a string with (n) copies of the same character
- From: "Evertjan." <exjxw.hannivoort@xxxxxxxxxxxx>
- Date: 19 Sep 2007 12:55:01 GMT
(O)enone wrote on 19 sep 2007 in microsoft.public.scripting.jscript:
I wish to create a function into which I pass a number, and it returns
a string containing that number of asterisks. So if I pass in the
number 5, it returns '*****'.
I can obviously do this by looping and adding a single asterisk to a
string for each iteration, but I'm sure JavaScript must offer a
cleaner way to do this.
Can anyone point me to a nice way to achieve this?
'This a school assignment?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.
- Follow-Ups:
- Re: Create a string with (n) copies of the same character
- From: \(O\)enone
- Re: Create a string with (n) copies of the same character
- From: Evertjan.
- Re: Create a string with (n) copies of the same character
- References:
- Create a string with (n) copies of the same character
- From: \(O\)enone
- Create a string with (n) copies of the same character
- Prev by Date: Create a string with (n) copies of the same character
- Next by Date: Re: Create a string with (n) copies of the same character
- Previous by thread: Create a string with (n) copies of the same character
- Next by thread: Re: Create a string with (n) copies of the same character
- Index(es):
Relevant Pages
|
Loading