0

Hello everyone,

I'm trying to create a diagram of numbers as represented by asterisks. I'm taking an integer and turning it into a string of *. For example, for the value of 4, it'd be ****. For the value of 7, it'd be *******. Does anyone know of a way this can be done? I just can't think of anything.

2
Contributors
1
Reply
4
Views
6 Years
Discussion Span
Last Post by JamesCherrill
0

To create a string of "n" stars:
1. Have a loop that executes n times and adds a star each time.
2. Start with a string that contains a lot of stars and use substring(...) to get the first n characters from that string.
3. I'm sure there are other ways as well.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.