// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // // // // string[] stringArrayAddPrefix(string $array[], string $prefix ) // // // Return the input array with the $prefix appended to each item. // // // string $array[] The string array. // // string $prefix The string to append to the beginning of each element in $array. // // // string[] : The input array with each elements prefixed by the $prefix string. // // // // // // stringArrayAddPrefix( { "a", "b", "c" }, ">" ); // ,Result:, >a >b >c // // // stringArrayAddPrefix( { "a", "b", "c" }, "___" ); // ,Result:, ___a ___b ___c // // // string $objs[] = { "a", "b", "c" }; // stringArrayAddPrefix( $objs, "***" ); // print $objs; // ***a // ***b // ***c // // // global proc string[] stringArrayAddPrefix( string $objects[], string $prefix ) { int $n = size( $objects ); for ( $i=0; $i<$n; $i++ ) $objects[$i] = stringAddPrefix( $objects[$i], $prefix ); return $objects; }