// =========================================================================== // 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[] stringArrayRemovePrefix(string $objects[], string $prefix ) // // // Return the input array with the $prefix removed from each item. // // // string $objects[] The input string array. // // string $prefix The string to be removed from the beginning of each item in $objects. // // // string : The input array with the $prefix removed from each item. // // // // // // stringArrayRemovePrefix( {}, "+++" ); // // ,Result:, // // // stringArrayRemovePrefix( { "a", "b", "c" }, "" ); // // ,Result:, a b c // // // stringArrayRemovePrefix( { "a", "b", "c" }, "***" ); // // ,Result:, a b c // // // stringArrayRemovePrefix( { "***a", "***b", "***c" }, "***" ); // // ,Result:, a b c // // // stringArrayRemovePrefix( { "***a", "+++b", "---c" }, "***" ); // // ,Result:, a +++b ---c // // // stringArrayRemovePrefix( { "***a", "", "---c" }, "***" ); // // ,Result:, a ---c // // // // global proc string[] stringArrayRemovePrefix( string $objects[], string $prefix ) { int $n = size( $objects ); for ( $i=0; $i<$n; $i++ ) $objects[$i] = stringRemovePrefix( $objects[$i], $prefix ); return $objects; }