asgarcymed
asked on
How to "subtract strings"?
The mathematical operators are easy to use and everybody knows:
$a=10
$b=1
$a + $b = 11
$a - $b = 9
However, if variables are strings rather than numbers, sometimes is confusing...
$a = "AAAAAAAZZZZZZZZZZZZZZZ"
$b = "ZZZZZZZZZZZZZZZ"
$a & $b (the correct; not $a + $b because no numbers!) = "AAAAAAAZZZZZZZZZZZZZZZAAA AAAAZZZZZZ ZZZZZZZZZ"
My question is - How to subtract characters using string variables?:
«$a - $b» = "AAAAAAA" (what is the correct expression, instead of «$a - $b»?)
Regards.
$a=10
$b=1
$a + $b = 11
$a - $b = 9
However, if variables are strings rather than numbers, sometimes is confusing...
$a = "AAAAAAAZZZZZZZZZZZZZZZ"
$b = "ZZZZZZZZZZZZZZZ"
$a & $b (the correct; not $a + $b because no numbers!) = "AAAAAAAZZZZZZZZZZZZZZZAAA
My question is - How to subtract characters using string variables?:
«$a - $b» = "AAAAAAA" (what is the correct expression, instead of «$a - $b»?)
Regards.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Best regards.