The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Moving characters in a string
Replies: 2   Last Post: Feb 24, 2013 8:32 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bruno Luong

Posts: 9,822
Registered: 7/26/08
Re: Moving characters in a string
Posted: Feb 24, 2013 7:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Joe" wrote in message <kgcq3f$j9i$>...
> Hello, I'm new to Matlab and having some trouble with some stuff.
> How would I moving characters in a string from one position to another.
> For example: original string='old123'
> newstring='123old'

String is an array. Just manipulate it as with an array:

newstring = oldstring([4:6 1:3])


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.