Go to: Synopsis. Return value. Related. MEL examples.

Synopsis

string[] stringArrayAddPrefix(string $array[], string $prefix )

Return the input array with the $prefix appended to each item.

Return value

None

Related

stringAddPrefix, stringArrayRemovePrefix, stringRemovePrefix

Arguments

Variable Name Variable Type Description
$arraystring[]The string array.
$prefixstringThe string to append to the beginning of each element in $array.

MEL examples

 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