string before - there is a foo bar and a bar foo and also foo and bar. swapString 1 - foo bar|bar foo|foo|bar string after first - there is a foo bar and a bar foo and also foo and bar.