Jump to content

remove line from array if it contains .vss

Recommended Posts

Best thing to do is check how your array is populated and avoid putting the data in it.

Checkout stringregexp in a "for loop". It is in the help file.

For the array you can use _ArrayDelete

Agreed, but I imagine StringInStr will be quicker, or even StringRight.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to post
Share on other sites

This one should be faster, with only one redim :

Local $aList[10] = ["file1.txt", "file2.pdf", "file3.png", "file4.jpg", "file5.doc", "file6.png", "file7.rtf", "file8.png", "file9.zip", "file10.xlsx"]

Local $iIndex = 0
For $i = 0 To UBound($aList) - 1
    If StringRight($aList[$i], 4) <> ".png" Then
        $aList[$iIndex] = $aList[$i]
        $iIndex += 1

Redim $aList[$iIndex]
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...