// =========================================================================== // 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 stringAddPrefix(string $object, string $prefix ) // // // Return a new string whose contents is the concatenation of $prefix and $object. // // // string $object The input string. // // string $prefix The string to append to the beginning of $object. // // // string : A new string whose contents is the concatenation of $prefix and $object. // // // // // // stringAddPrefix( "a", "" ); // ,Result:, a // // // print( size( stringAddPrefix( "", "" ) ) ); // ,Result:, 0 // // stringAddPrefix( "a", "___" ); // ,Result:, ___a // // // // // global proc string stringAddPrefix( string $object, string $prefix ) { if ( size( $prefix ) ) $object = $prefix + $object; return $object; }