While i agree with your suggestion to allways Super Search first...

Just because there is a more complete problem, doesn't mean a person is interested in a solution to the complete problem -- in many cases the problems people face are simple subsets of larger "complete" problems.

Regardless of the posters subject, it was very clear that the input would be "1234567890" and the desired output was "(123) 456-7890"

If I was in a situation like that, where I knew my input would be limited to exactly 10 digits, with no punctuation, and i found node#159645 ... i would consider it severe overkill, and ask the question anyway. (Because I don't care about the obscure phone number rules of various countries ... i care about formating 10 digits)


In reply to Re: Re: formatted phone number from variable by hossman
in thread formatted phone number from variable by powerhouse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.