Utility method to swap two characters in a String
static String swap ( String num , int i , int j ) { StringBuilder sb = new StringBuilder ( num ) ; sb [ i ] = num [ j ] ; sb [ j ] = num [ i ] ; return sb . ToString ( ) ; }