string strip operator

The string strip operator  '-'  requires that both operands be of type string. If one is a string and the other is not than the string may be coerced to a non string and the arithmetic 'subtract' operation performed. This depends on the type and position of the non string operand. See type coercion for more details.

The string strip operator will remove the string given as the second operand from the string given as the first operand provided that the string appears at the start and matches exactly.

e.g.

A   =   "helloworld"
B   =   "hello"
C   =   A - B

would set   C   to the string   "world"

e.g.

A   =   "helloworld"
B   =   "  hello"
C   =   A - B

would set   C   to the string   "helloworld"

e.g.

A   =   "helloworld"
B   =   "hello  "
C   =   A - B

would set   C   to the string   "helloworld"

e.g.

A   =   "hello"
B   =   27
C   =   A - B

would set   C   to the string   "hello"

e.g.

A   =   27
B   =   "world"
C   =   A - B

would set   C   to the integer   27

e.g.

A   =   27
B   =   "world"
C   =   $A - B

would set   C   to the string   "27"