Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5266
  • Last Modified:

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!) = "AAAAAAAZZZZZZZZZZZZZZZAAAAAAAZZZZZZZZZZZZZZZ"


My question is - How to subtract characters using string variables?:

«$a - $b» = "AAAAAAA" (what is the correct expression, instead of «$a - $b»?)


Regards.
0
asgarcymed
Asked:
asgarcymed
1 Solution
 
Patrick MatthewsCommented:
MsgBox Replace(a, b, "")
0
 
asgarcymedAuthor Commented:
Works fine; thank you!
Best regards.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now