Print all possible strings that can be made by placing spaces | C # program to print all strings that can be made by placing spaces ; Function to print all subsequences ; Driver code
using System ; class GFG { 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 ( ) ; } } public static void Main ( ) { String str = " ABC " ; printSubsequences ( str ) ; } }