How to remove line breaks in C string

How to remove line breaks in C string
‮‬refer to:lautturi.com
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[]) {

	char str[100] = {'l','a','u','f','t','\n','i','d','e','a','\n','w'};

	printf("%s\n",str);

    str[strcspn(str, "\n")] = ' '; // convert the first line break to space

	printf("%s",str);
	return 0;
}
Created Time:2017-08-29 10:20:18  Author:lautturi