// C program for splitting a string 
// using strtok() 
#include <stdio.h> 
#include <string.h> 

int main() 
{ 
	char str[] = "Geeks-for-Geeks"; 

	// Returns first token 
	char* token = strtok(str, "-"); 

	// Keep printing tokens while one of the 
	// delimiters present in str[]. 
	while (token != NULL) { 
		printf("%s", token); 
		token = strtok(NULL, "-"); 
	} 

	return 0; 
} 

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: