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

Re: reverse a string in place

by choroba (Abbot)
on Mar 24, 2013 at 07:33 UTC ( #1025124=note: print w/ replies, xml ) Need Help??


in reply to reverse a string in place

In Perl, a string is not an array of characters as in C. Reversing a string is easy, though: use reverse:

$string = reverse $string;

Update: What do you mean by doing it "without using any built-in function"? In your example, are you going to implement floor yourself?

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: reverse a string in place
Select or Download Code
Re^2: reverse a string in place
by Anonymous Monk on Mar 24, 2013 at 07:47 UTC

    choroba,
    You really made laugh my heart out with your comment: "What do you mean by doing it "without using any built-in function"? In your example, are you going to implement floor yourself?"
    Tripple ++ to you....

      by 'without using any built-in' i meant the 'reverse' function in perl which is used to reverse the string.

        That is why one should be clear, when asking questions or asking for help from others.
        No problems, I am sure you have all the helps that you need now..

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-12-29 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls