Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Insert comma after every character

by JavaFan (Canon)
on Apr 21, 2010 at 14:18 UTC ( #836073=note: print w/replies, xml ) Need Help??


in reply to Insert comma after every character

So, you have "F", "B", a space, "D" and want to turn that into "F", comma, space, "B", comma, space, "D"? The simplest way is:
$str = "F, B, D" if $str eq "FB D";
Are we free to generalize this? Here's a broad generalization:
$str = "F, B, D";
Or do you want something else? Perhaps you can describe it, instead of assume we're all omniscient, and can deduce what you want from a single example, and some botched code.

Replies are listed 'Best First'.
Re^2: Insert comma after every character
by johngg (Canon) on Apr 21, 2010 at 16:12 UTC
    you have "F", "B", a space, "D"

    I don't think there's a space there, I can't see one when viewing the page source.

    Cheers,

    JohnGG

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2022-12-07 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?