Valuater Posted June 12, 2005 Posted June 12, 2005 Just a little clearification Are'nt these the same ????? $result = StringTrimLeft($myArray, 3) $result = _ArrayTrim( $myArray, 3) or is there a more specific use thx 8)
therks Posted June 12, 2005 Posted June 12, 2005 (edited) Depends on what is in $myArray.#include <Array.au3> Dim $myarray[2] $myarray[0] = 'Hello world' $myarray[1] = 'Ola senior!' msgbox(0,'Default', $myarray[0] & @LF & $myarray[1]) StringTrimLeft($myarray, 3) msgbox(0,'StringTrimLeft', $myarray[0] & @LF & $myarray[1]) _ArrayTrim($myarray, 3) msgbox(0,'_ArrayTrim', $myarray[0] & @LF & $myarray[1])Note that StringTrimLeft, didn't do anything, because a) It doesn't work on arrays, and It doesn't affect the variable by reference, it returns the changed string.In fact, if you do this:Dim $myarray[2] $myarray[0] = 'Hello world' $myarray[1] = 'Ola senior!' $myarray = StringTrimLeft($myarray, 3) msgbox(0,'Default', $myarray[0] & @LF & $myarray[1])You get an error because $myarray is no longer an array.I can't actually see how you assumed that either of them do the same thing at all. Did you even try them first? Edited June 12, 2005 by Saunders My AutoIt Stuff | My Github
Valuater Posted June 12, 2005 Author Posted June 12, 2005 no, i didn't try them first.. this is new ground for me and i did not know how to test it to this degree You gave an absolutely perfect example............ thank you 8)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now