Click here to Skip to main content
16,006,378 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Preview a word document from access Pin
thetuxpenguin25-May-05 4:57
thetuxpenguin25-May-05 4:57 
GeneralRe: Preview a word document from access Pin
Anonymous26-May-05 1:11
Anonymous26-May-05 1:11 
GeneralDeleting a Positon in an array Pin
harrysk25-May-05 1:29
harrysk25-May-05 1:29 
GeneralRe: Deleting a Positon in an array Pin
toxcct25-May-05 1:42
toxcct25-May-05 1:42 
GeneralRe: Deleting a Positon in an array Pin
harrysk25-May-05 2:27
harrysk25-May-05 2:27 
GeneralRe: Deleting a Positon in an array Pin
rudy.net25-May-05 3:31
rudy.net25-May-05 3:31 
GeneralRe: Deleting a Positon in an array Pin
harrysk25-May-05 3:49
harrysk25-May-05 3:49 
GeneralRe: Deleting a Positon in an array Pin
rudy.net25-May-05 4:11
rudy.net25-May-05 4:11 
Here is the code using Array.Copy, although it's probably easier to create a loop and copy all elements in an array except the one you want to delete.
Dim str As String = "This is my original string"<br />
Dim originalArray() As String = str.Split(" ")<br />
'now to remove the fourth word: (index 3)<br />
Dim indexToRemove = 3<br />
Dim newArray(originalArray.Length - 2) As String<br />
Dim numElementsToCopyFirst = indexToRemove 'copy everything up to index right before the element to be removed<br />
Array.Copy(originalArray, 0, newArray, 0, numElementsToCopyFirst)<br />
Dim numElementsToCopySecond = originalArray.Length - indexToRemove - 1<br />
Array.Copy(originalArray, indexToRemove + 1, newArray, numElementsToCopyFirst, numElementsToCopySecond)<br />
'now replace original array<br />
ReDim originalArray(newArray.Length - 1)<br />
Array.Copy(newArray, originalArray, newArray.Length)

GeneralRe: Deleting a Positon in an array Pin
toxcct25-May-05 4:11
toxcct25-May-05 4:11 
GeneralRe: Deleting a Positon in an array Pin
harrysk25-May-05 6:15
harrysk25-May-05 6:15 
GeneralRe: Deleting a Positon in an array Pin
toxcct25-May-05 20:28
toxcct25-May-05 20:28 
Generalentering data Pin
Manik Nath24-May-05 23:44
Manik Nath24-May-05 23:44 
GeneralRe: entering data Pin
albCode25-May-05 8:30
albCode25-May-05 8:30 
GeneralIExplorer Bar Pin
landsmann24-May-05 23:03
landsmann24-May-05 23:03 
GeneralProblem in MDI form with Picture Box Pin
Murtuza Husain Miyan Patel24-May-05 22:07
professionalMurtuza Husain Miyan Patel24-May-05 22:07 
GeneralRe: Problem in MDI form with Picture Box Pin
toxcct24-May-05 22:29
toxcct24-May-05 22:29 
Generalvalidation control box in vb6.. Pin
Member 194028724-May-05 21:15
Member 194028724-May-05 21:15 
GeneralRe: validation control box in vb6.. Pin
Dave Kreskowiak25-May-05 3:22
mveDave Kreskowiak25-May-05 3:22 
GeneralRe: validation control box in vb6.. Pin
GuruPandian25-May-05 3:49
GuruPandian25-May-05 3:49 
GeneralRe: validation control box in vb6.. Pin
Member 194028725-May-05 10:48
Member 194028725-May-05 10:48 
GeneralPS2 Comm Pin
Kilua1124-May-05 21:08
Kilua1124-May-05 21:08 
GeneralRe: PS2 Comm Pin
Dave Kreskowiak25-May-05 3:20
mveDave Kreskowiak25-May-05 3:20 
GeneralRe: PS2 Comm Pin
jonathan1525-May-05 3:35
jonathan1525-May-05 3:35 
QuestionHow to set the selecteditem of a Combox control ? Pin
rushing24-May-05 17:44
rushing24-May-05 17:44 
AnswerRe: How to set the selecteditem of a Combox control ? Pin
toxcct24-May-05 20:26
toxcct24-May-05 20:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.