spunkywacko 0 Newbie Poster 14 Years Ago I have an array with 100 elements. How can copy only 10 element to a new array? Copy to Clipboardstring[] NewArray = (string[])MyArray.Clone(); Thank you. 0 0 Reply with Quote Share Recommended Answers Collapse Answers Answered by Momerath 1,327 in a post from 14 Years Ago Array.Copy(Array, Int32, Array, Int32, Int32) For example, if you want to copy 10 elements starting at the 23rd you'd use Copy to Clipboardstring[] newArray = new String[10]; Array.Copy(myArray, 23, newArray, 0, … Jump to Post All 2 Replies Momerath 1,327 Nearly a Senior Poster Featured Poster 14 Years Ago Array.Copy(Array, Int32, Array, Int32, Int32) For example, if you want to copy 10 elements starting at the 23rd you'd use Copy to Clipboardstring[] newArray = new String[10]; Array.Copy(myArray, 23, newArray, 0, 10); 1 0 Reply with Quote Share spunkywacko 0 Newbie Poster 14 Years Ago Thank you! 0 0 Reply with Quote Share Share Facebook Twitter LinkedIn Reply to this topic Be a part of the DaniWeb community We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge. Sign Up — It's Free!
Momerath 1,327 Nearly a Senior Poster Featured Poster 14 Years Ago Array.Copy(Array, Int32, Array, Int32, Int32) For example, if you want to copy 10 elements starting at the 23rd you'd use Copy to Clipboardstring[] newArray = new String[10]; Array.Copy(myArray, 23, newArray, 0, 10); 1 0 Reply with Quote Share