Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How do I split up a long string with no spaces?

by Daddio (Chaplain)
on May 12, 2001 at 21:56 UTC ( [id://79958]=note: print w/replies, xml ) Need Help??


in reply to How do I split up a long string with no spaces?

You can also create a neat array of the strings using this:

my $string = "thisisalongstringofcharacters"; my (@strings) = split /(.{5})/,$string;

Season the '5' in the split to taste. Gives a nice array for use in whatever you need it for.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://79958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-24 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found