string substrings, swapping, and finding