Sign in to follow this  
Followers 0
redndahead

Triming Array Udf

1 post in this topic

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

Share this post


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
Sign in to follow this  
Followers 0