String matching with * ( that matches with any ) in any of the two strings | C # program for string matching with ; Function to check if the two strings can be matched or not ; if the string don 't have *  then character at that position  must be same. ; Driver code
using System ; class GfG { public static int doMatch ( String A , String B ) { for ( int i = 0 ; i < A . Length ; i ++ ) { if ( A [ i ] != ' * ' && B [ i ] != ' * ' ) if ( A [ i ] != B [ i ] ) return 0 ; } return 1 ; } public static void Main ( String [ ] args ) { String A = " gee * sforgeeks " ; String B = " geeksforgeeks " ; Console . WriteLine ( doMatch ( A , B ) ) ; } }