Alright, dadburn it, you guys made me think!
In-string swap with no temps and no other changes to string:
(https://en.wikipedia.org/wiki/XOR_swap_algorithm)
In-string swap with no temps and no other changes to string:
Code: (Select All)
a$ = "ABCDEFG"
Print a$
Mid$(a$, 3, 1) = Chr$(Asc(Mid$(a$, 3, 1)) Xor Asc(Mid$(a$, 5, 1)))
Mid$(a$, 5, 1) = Chr$(Asc(Mid$(a$, 3, 1)) Xor Asc(Mid$(a$, 5, 1)))
Mid$(a$, 3, 1) = Chr$(Asc(Mid$(a$, 3, 1)) Xor Asc(Mid$(a$, 5, 1)))
Print a$
(https://en.wikipedia.org/wiki/XOR_swap_algorithm)