Copy a string: Difference between revisions
Content added Content deleted
(Objective C, various string copying options) |
(About copying vs referencing) |
||
Line 175: | Line 175: | ||
[[Category:Python]] |
[[Category:Python]] |
||
'''Interpeter:''' Python 2.3, 2.4, 2.5 |
'''Interpeter:''' Python 2.3, 2.4, 2.5 |
||
⚫ | |||
Since strings are immutable, this will not copy anything, just point dst to the same string: |
|||
⚫ | |||
⚫ | |||
⚫ | |||
To actually copy the string: |
|||
dst = src[:] |
|||
==[[Ruby]]== |
==[[Ruby]]== |