ch 10/e8.c
//Function to find and replace a sub string in a main string

Function to find and replace a sub string in a main string
Function to find and replace a sub string in a main string
int search_destroy ( char source [], char find [], char replace [] )
 {
 	int findString ( char main_text [], char sub_text [] ) ;	
	void remString ( char text [], int index, int noe ) ;
	void insertString ( char m_text [], char s_text [], int index ) ;	
	int index = findString ( source, find ) ;		
	if ( index == -1)
	 return -1 ;
	remString ( source, index, strlen (find) ) ;	
	insertString ( source, replace, index ) ;		
	return 1 ;
 }
int search_destroy ( char source [ ] , char find [ ] , char replace [ ] ) { int findString ( char main_text [ ] , char sub_text [ ] ) ; void remString ( char text [ ] , int index , int noe ) ; void insertString ( char m_text [ ] , char s_text [ ] , int index ) ; int index = findString ( source , find ) ; if ( index == -1 ) return -1 ; remString ( source , index , strlen ( find ) ) ; insertString ( source , replace , index ) ; return 1 ; }
Function to find and replace a sub string in a main string
Function to find and replace a sub string in a main string
//Function declarations
 //Finding if sub string exists in main string
 //Removing located sub string from main string
 //Replacing sub string inside main string
