added swap api for string class

Please review.