Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array

Status
Not open for further replies.

hariram55

Programmer
Jul 28, 2006
10
US
Hi friends,

I got simple question about array. Let suppose I got 2 array’s,

Dim SourceArray(300) as integer
Dim DestArray(100) as integer

Now I want to copy value of SourceArray (with the beginning index of 101 and ending index of 200) to DestArray.
Is there any way to do that with one line code (e.g., using copy command)

Thank you.
 
With this:

Code:
  System.Buffer.BlockCopy(SourceArray, 101, DestArray, 0, 100)
 
Or
Code:
Array.Copy(SourceArray, 101, DestArray, 0, DestArray.Length)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top