in reply to Re: Golf: Replacing part of a string with "*"
in thread Golf: Replacing part of a string with "*"

Still not right. It should be printing the *last* four (************5678).
  • Comment on Re^2: Golf: Replacing part of a string with "*"

Replies are listed 'Best First'.
Re^3: Golf: Replacing part of a string with "*"
by BrowserUk (Patriarch) on Aug 18, 2006 at 15:53 UTC

    Ah! Then

    printf "************%s\n", substr('5424123412345678', -4);; ************5678

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.