Characters in strings are sometimes represented as their ASCII hexadecimal codes. Printable characters have two hex digits in their representation. Swapping those digits leads to another character, which will be our output.
The table of relevant character codes can be found on Wikipedia.
Take a string as input.
For each character:
Find corresponding hex value of ASCII code.
Swap (reverse) the hex digits.
Convert back to character.
Output the new string.
To make thinks easier, let's consider only characters "reversible" within standard printable ASCII range - that is codepoints (in hex): 22-27,32-37,42-47,52-57,62-67,72-77 or characters: "#$%&'234567BCDEFGRSTUVWbcdefgrstuvw.
Input and output should be strings or closest equivalent in your language of choice.
; = x PROMPT # x = input()
; = y "" # y = ""
; = i ~1 # i = -1
; WHILE (< (= i (+ 1 i)) (LENGTH x)) # while (i = i + 1) < length(x):
: = y (+ y (ASCII (% (* 16 (ASCII (GET x i 1))) 255))) # y = y + chr((ord(x[i]) * 16) % 255)
: OUTPUT y # print(y)
Golfed Steffan's answer to minimize the use of auxiliary variables. y is not necessary if we print each char right away; i is not necessary since A implicitly grabs the 0th char from the current string and we can chop x directly.
; = x P x = a line of stdin
: W x While x is nonempty:
; O + A % * 16 A x 255 "\" Output chr(ord(x) * 16 % 255) + "\"
(to suppress the implicit newline ending)
: = x G x 1 L x x = x[1:]
If output of each char separated by newline is allowed:
mCi_.Hd16 | Full program
mCi_.Hd16Q | with implicit variables
m Q | For each character d of the input,
.Hd | Convert to hexstring
_ | Reverse
i 16 | Convert from base 16
C | Convert to character