C # program to find indices of all occurrences of one String in other .
using System ; class GFG { static void printIndex ( String str , String s ) { bool flag = false ; for ( int i = 0 ; i < str . Length - s . Length + 1 ; i ++ ) { if ( str . Substring ( i , s . Length ) . Equals ( s ) ) { Console . Write ( i + " ▁ " ) ; flag = true ; } } if ( flag == false ) { Console . WriteLine ( " NONE " ) ; } }