C# From A to Z - Lesson 36: Strings (Clone - Copy - CopyTo)

C# From A to Z - Lesson 36: Strings (Clone - Copy - CopyTo)


Lessons Index:

Lesson 1: Comments
Lesson 2: Value vs Reference Types
Lesson 3: Built-in Value Types
Lesson 4: Variables and Constants
Lesson 5: Variables & Constant Examples
Lesson 6: Operators
Lesson 7: Operators Examples
Lesson 8: Casting & Conversion
Lesson 9: Casting & Conversion Examples
Lesson 10: Enumerations
Lesson 11: Enumerations Examples
Lesson 12: The USING Statement
Lesson 13: The IF Statement
Lesson 14: The Switch Statement
Lesson 15: Loops
Lesson 16: Loops Examples
Lesson 17: Declaring Variables
Lesson 18: Access Modifiers
Lesson 19: Constants
Lesson 20: Type Converting
Lesson 21: System.Convert Classes
Lesson 22: System.Convert Shortcuts
Lesson 23: Formatting Output
Lesson 24: Object Oriented Programming (OOP) - Part1
Lesson 25: OOP - Part2
Lesson 26: OOP - Part3
Lesson 27: OOP - Part4
Lesson 28: OOP - Part5
Lesson 29: OOP - Part6
Lesson 30: OOP - Part7
Lesson 31: OOP - Part8
Lesson 32: .NET Strings
Lesson 33: Strings Length & Case
Lesson 34: Concatenate & StringBuilder
Lesson 35: More StringBuilder
Lesson 36: Clone - Copy - CopyTo
Lesson 37: Substrings - Trim - Pad ... Part1
Lesson 38: Substrings - Trim - Pad ... Part2
Lesson 39: GetType - Compare - Equality
Lesson 40: Regular Expressions...Part1
Lesson 41: Regular Expressions...Part2
Lesson 42: String Format
...and more to come.
Closed Caption:

let's talk about copy
cloning and copy to now we know that
string builders going to be a lot better
for
topping and working with our strange
because the string
type is immutable and its reference
type:
and it's going to create a new optics
whenever it needs to actually
create a copy or concatenate strings
together
because it immutable you can change it
so it has to create a new copy for that
so for fish in sea sick
stream builders really really fast
extremely fast but we can continue
just to show you how you can actually
work with cloning copying
and copy to cloning is going to create
and object that's based on this track so
you but specified object give
their opponents not and then you going
to do estar con
to actually clone this train into an
object
so then we're going to actually be up to
change this object actually
just like that and then when we write it
out want to write out we're going to use
the doc to string
to specify that as the output because
that's going to be available
from the dot notation because we're
dealing with an object
now them want output are
old string to see that it's still going
to be what it is for making a copy
but we're awesome cloning it into an
object so when I'm actually referencing
the same data area because we can
actually see that the first ring
is still intact but we're creating a
reference to eight new copy a clone of
this critical project
of the string so take pic that and then
you see that
after the con copy copy to strings setup
s2 has been set the exclamation s wanna
still want it used to be
and now let's see how the other ones
work as well
so we're creating a reference though
creating an object
and a reference to data now
the copy here
this is going to create a copy of our
string into another structure
s trees on a string and then we're just
going to string that copy
and then the name of the variable the
string that we want to copy
so this is another way to do that to
copy and if you want to copy to
what we're doing is we're copying tomb
and array of charge as you can see here
recruiting charge
an array of three charge in this format
and then we're doing esta copy to them
because that's available from team
actual string variable there
there would be the start of our index
charge would be the
character string the character rang that
we want to actually
copy to and we're going to copy this
into are
capture a wreck so this is going to be
where we're going to start
within our chars and this is the link
the number of characters were going to
put into this array of characters
so different way she could work with
continuing to work with your strengths
it's really robust there's a lot of ways
you can actually work and working with
an object in strange and
back and forth and dealing with the
references its
pretty much up to you how you want to
deal with thanks StringBuilder again
it's going to be
the fastest way to process your
strengths and it's going to be extremely
efficient
so it's been at it for you and its
optimizing it works really really nicely
so
I would suggest you work a lot with the
StringBuilder

Video Length: 03:27
Uploaded By: zoom1177
Published: 2/10/2010
View Count: 4,171

Related Software Products
CopyTo
CopyTo

Published By:
VSO Software

Description:
Burn CDs, DVDs, and Blu-ray disks. CopyTo is compatible with all disks and drives. Burn audio / video / data / iso files and compatible DVD video and blu-ray structured folders. A smart data analyzer integrated in CopyTo makes your burning tasks easier as the program suggests the best output format (burn audio CD, burn to DVD, burn DVD Video...). Besides burning you can also copy from disk to disk. Version 5 has added special support for your music needs: create mp3 disks (converts your files ...


Related Videos
How to use Dynamics NAV Copy to and from Excel
How to use Dynamics NAV Copy to and from Excel

Video Length: 12:01
Uploaded By: Eric Durand (3/23/2014)
View Count: 23,623

Visual Basic 2010 Copy To StartUp Tutorial
Visual Basic 2010 Copy To StartUp Tutorial

Video Length: 06:00
Uploaded By: Jakob Erzar (12/5/2010)
View Count: 8,713

C# List CopyTo and ToArray
C# List CopyTo and ToArray

Video Length: 04:13
Uploaded By: Jamie King (1/16/2014)
View Count: 5,668

A Simple XY script: copyto
A Simple XY script: copyto

Video Length: 01:37
Uploaded By: Seren dipity (2/3/2013)
View Count: 969

Add 'CopyTo' & 'MoveTo' in Context Menu
Add 'CopyTo' & 'MoveTo' in Context Menu

Video Length: 01:47
Uploaded By: furulevi (8/17/2012)
View Count: 548

ACDSee Pro 6. 'CopyTo...' - delay demo
ACDSee Pro 6. 'CopyTo...' - delay demo

Video Length: 01:03
Uploaded By: Lars Hansen (3/23/2013)
View Count: 339

Copyright © 2026, Ivertech. All rights reserved.