>>237
char * str = "abcdefg";
char * p = strchr(str, 'd');
printf("%.*s", p - str, str);