Function to print all subsequences
static void printSubsequences ( String s ) { char [ ] str = s . ToCharArray ( ) ; int n = str . Length ; int opsize = ( int ) ( Math . Pow ( 2 , n - 1 ) ) ; for ( int counter = 0 ; counter < opsize ; counter ++ ) { for ( int j = 0 ; j < n ; j ++ ) { Console . Write ( str [ j ] ) ; if ( ( counter & ( 1 << j ) ) > 0 ) Console . Write ( " ▁ " ) ; } Console . WriteLine ( ) ; } }