Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: reverse a string in place

by choroba (Canon)
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
Replies are listed 'Best First'.
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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-08-29 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (343 votes), past polls