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

Synopsis

string stringRemovePrefix(string $object, string $prefix )

Return a new string whose contents is equivalent to $object without $prefix

Return value

None

Related

stringAddPrefix, stringArrayAddPrefix, stringArrayRemovePrefix

Arguments

Variable Name Variable Type Description
$objectstringThe input string.
$prefixstringThe string to be removed from the beginning of $object.

MEL examples

 stringRemovePrefix( "a", "" );
 // ,Result:, a // 

 size( stringRemovePrefix( "", "a" ) );
 // ,Result:, 0 // 

 stringRemovePrefix( "aa", "a" );
 // ,Result:, a // 

 stringRemovePrefix( "a", "___" );
 // ,Result:, a // 

 stringRemovePrefix( "a", "abc" );
 // ,Result:, a // 

 size( stringRemovePrefix( "a", "a" ) );
 // ,Result:, 0 //