Driver code
using System ; public class GFG { static bool unique ( String s ) { Array . Sort ( s . ToCharArray ( ) ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == s [ i + 1 ] ) { return false ; } } return true ; } public static void Main ( String [ ] args ) { if ( unique ( " abcdd " ) == true ) { Console . WriteLine ( " String ▁ is ▁ Unique " ) ; } else { Console . WriteLine ( " String ▁ is ▁ not ▁ Unique " ) ; } } }