TASdvlper has asked for the wisdom of the Perl Monks concerning the following question:
I've read some of the threads here on counting characters in a string, and I got some good information, but not quite all the answers I was looking for. Say I have a string:
What I want to do is print n-amount of characters then start a new line. So, say n = 5 (where n is actually a variable). The output would be:my $string = "this is just a test\nthis is another test\nthis is yet a +nother test\n";
any thoughts on this ???this(space) is ju st a t est\nt this(space) is an ... an so on ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Counting characters in a string
by duff (Parson) on Feb 06, 2004 at 14:41 UTC | |
|
Re: Counting characters in a string
by Sol-Invictus (Scribe) on Feb 06, 2004 at 15:15 UTC | |
|
Re: Counting characters in a string
by Roy Johnson (Monsignor) on Feb 06, 2004 at 14:39 UTC | |
|
Re: Counting characters in a string
by valentin (Abbot) on Feb 06, 2004 at 14:40 UTC | |
by ysth (Canon) on Feb 06, 2004 at 16:02 UTC | |
by valentin (Abbot) on Feb 06, 2004 at 16:15 UTC | |
|
Re: Counting characters in a string
by duff (Parson) on Feb 06, 2004 at 15:06 UTC | |
|
Re: Counting characters in a string
by arden (Curate) on Feb 06, 2004 at 14:43 UTC | |
|
Re: Counting characters in a string
by ysth (Canon) on Feb 06, 2004 at 16:28 UTC | |
|
Golf?: Counting characters in a string
by mr_mischief (Monsignor) on Feb 06, 2004 at 16:01 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |