dwcronin
asked on
print spaces without typing them all
Using Perl and hopefully regular expressions, how do I print a specific number of characters like spaces?
For example. I want to make a "for" loop that counts to three and then have the program print out:
1 space then "a"
2 spaces then "a"
3 spaces then "a"
For example. I want to make a "for" loop that counts to three and then have the program print out:
1 space then "a"
2 spaces then "a"
3 spaces then "a"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
printf "%${i}s\n", 'a';
}