added swap API to string class