Driver code
public static void Main ( String [ ] args ) { char [ ] str = " baaabab " . ToCharArray ( ) ; char [ ] pattern = " * * * * * ba * * * * * ab " . ToCharArray ( ) ; char pattern [ ] = " ba * * * * * ab " ; char pattern [ ] = " ba * ab " ; char pattern [ ] = " a * ab " ; if ( strmatch ( str , pattern , str . Length , pattern . Length ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; char [ ] pattern2 = " a * * * * * ab " . ToCharArray ( ) ; if ( strmatch ( str , pattern2 , str . Length , pattern2 . Length ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }