- Turn the String into List.
- Sort it.
- Join it back as a String.
And then, I stumbled upon a better way to do string comparison. Convert them to sets!!!
set(stringA).difference(stringB)
Note that it may not be same as
set(stringB).difference(stringA)
Details on set theory here:
set(stringB).difference(stringA)
Details on set theory here:
Discussion here: