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

Re: reverse a string in place

by choroba (Chancellor)
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?

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

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 imbibing at the Monastery: (9)
As of 2016-08-29 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (398 votes). Check out past polls.