Results 1 to 5 of 5

Thread: removing the first item of an array of strings?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    removing the first item of an array of strings?

    uuh I wrote this, but it looks really ugly and dumd any better ways?
    VB Code:
    1. Dim args As New ArrayList
    2.             args.AddRange(Environment.GetCommandLineArgs())
    3.  
    4.             If args.Count > 1 Then
    5.                 args.RemoveAt(0)
    6.  
    7.                 Dim filenames() As String
    8.                 filenames = CType(args.ToArray(GetType(String)), String())
    9. ....

    I just want to remove the first element of args(). That works but looks akward... just wondering if there is a better way
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    The other dumb way is copy the array to another array starting from the second element not the first and then dispose the first array obj .

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Pirate
    The other dumb way is copy the array to another array starting from the second element not the first and then dispose the first array obj .
    how do you do that
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by MrPolite
    how do you do that
    VB Code:
    1. Dim arry2 As ArrayList = arry1.GetRange(1, arry1.Count - 1)
    2.         For Each s As String In arry2
    3.             MsgBox(s)
    4.  Next

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Pirate
    VB Code:
    1. Dim arry2 As ArrayList = arry1.GetRange(1, arry1.Count - 1)
    2.         For Each s As String In arry2
    3.             MsgBox(s)
    4.  Next
    ooh yeah you're right arraylists
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width