Computing.Net > Forums > Unix > Display a character n times..

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Display a character n times..

Reply to Message Icon

Name: deeps
Date: July 10, 2006 at 13:01:17 Pacific
OS: Unix/Windows
CPU/Ram: 1GB
Comment:

How can a print a character n times on output screen.
For example, i wish to display character "%" 10 times.
Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: deeps
Date: July 10, 2006 at 13:01:58 Pacific
Reply:

If the same can be shown in perl


0

Response Number 2
Name: deeps
Date: July 14, 2006 at 10:52:51 Pacific
Reply:

Does anyone have a concise statement for this command.

print "%%%%%%%%%%";

Instead could there be a one line such as

print "%",10times;

This has to be done without using a loop.


0

Response Number 3
Name: deeps
Date: July 14, 2006 at 11:29:06 Pacific
Reply:

Got that...

For help of others,

print "%" x 10

The above statement is for perl

Please do contribute to the forum.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Display a character n times..

display unprintable characters www.computing.net/answers/unix/display-unprintable-characters/4893.html

How to display 1 character from str www.computing.net/answers/unix/how-to-display-1-character-from-str/7565.html

How do I echo a $ character? www.computing.net/answers/unix/how-do-i-echo-a-character/2979.html