Jump to content

Triming Array Udf


redndahead
 Share

Recommended Posts

I made this one while making my UDFManager. Might be nice to include in the UDF's. The first one really helped me get rid of extensions in an array list of files.

;===============================================================================
;
; Description:      Trims group of elements in an array a certain amount right.
; Syntax:           _TrimArrayRight( $sArray,$nAmount,$nBegin,$nEnd )
; Parameter(s):     $sArray - The array to trim (Array).
;                  $nAmount - The amount to trim (numeric).
;                  $nBegin - What element to begin with (numeric).
;                  $nEnd - What element to end with (numeric).               
; Requirement(s):   None
; Return Value(s):  On Success - Returns the array back with trimed elements.
;                   On Failure - None
; Author(s):        Adam Moore <ane61000@yahoo.com>
; Note(s):          None
;
;===============================================================================
Func _TrimArrayRight($a,$b,$c,$d)
    For $i=$c to $d
        $a[$i]=StringTrimRight($a[$i],$b)
    Next
    Return($a)
EndFunc


================================
;
; Description:      Trims group of elements in an array a certain amount left.
; Syntax:           _TrimArrayLeft( $sArray,$nAmount,$nBegin,$nEnd )
; Parameter(s):     $sArray - The array to trim (Array).
;                  $nAmount - The amount to trim (numeric).
;                  $nBegin - What element to begin with (numeric).
;                  $nEnd - What element to end with (numeric).               
; Requirement(s):   None
; Return Value(s):  On Success - Returns the array back with trimed elements.
;                   On Failure - None
; Author(s):        Adam Moore <ane61000@yahoo.com>
; Note(s):          None
;
;===============================================================================
Func _TrimArrayLeft($a,$b,$c,$d)
    For $i=$c to $d
        $a[$i]=StringTrimLeft($a[$i],$b)
    Next
    Return($a)
EndFunc

red

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...