Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Counting to add space to a string

by Util (Priest)
on Sep 22, 2011 at 15:48 UTC ( [id://927408]=note: print w/replies, xml ) Need Help??


in reply to Re: Counting to add space to a string
in thread Counting to add space to a string

In your first example, your code is inserting the X after the fourth char, but the OP says "after the initial letters".

  • Comment on Re^2: Counting to add space to a string

Replies are listed 'Best First'.
Re^3: Counting to add space to a string
by ww (Archbishop) on Sep 22, 2011 at 16:16 UTC

    Good point; ++. Another arguement for regex and length!>

    I failed to consider that OP's substr($account_1, 4, 0) hard codes the insert point; in fact, offhand, I don't see a direct way (other than a regex to find the last, initial letter (.oO ... there might be some non-initial letters? pos, and length) to fix that in my code.

    Update: That is, I didn't see it until your Re: Counting to add space to a string. Elegant and concise: ++ again!

Log In?
Username:
Password:

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

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

    No recent polls found